diff --git a/site/.dockerignore b/site/.dockerignore new file mode 100644 index 0000000000..0822df13e4 --- /dev/null +++ b/site/.dockerignore @@ -0,0 +1,9 @@ +/* +!/Dockerfile +!/package.json +!/package-lock.json +!/__sapper__ +/__sapper__/* +!/__sapper__/build +!/static +!/content diff --git a/site/.gcloudignore b/site/.gcloudignore new file mode 100644 index 0000000000..c46042a27e --- /dev/null +++ b/site/.gcloudignore @@ -0,0 +1 @@ +#!include:.dockerignore diff --git a/site/Dockerfile b/site/Dockerfile index 6674e45336..b7012f9cfe 100644 --- a/site/Dockerfile +++ b/site/Dockerfile @@ -2,11 +2,8 @@ FROM mhart/alpine-node:10.15 # install dependencies WORKDIR /app -COPY static /app/static -COPY content /app/content -COPY __sapper__ /app/__sapper__ -COPY package.json package-lock.json /app/ -RUN npm install --production +COPY package.json package-lock.json ./ +RUN npm ci --production ### # Only copy over the Node pieces we need @@ -16,6 +13,7 @@ FROM mhart/alpine-node:base-10.15 WORKDIR /app COPY --from=0 /app . +COPY . . EXPOSE 3000 CMD ["node", "__sapper__/build"] diff --git a/site/Makefile b/site/Makefile index c41be0fda7..c8d8b236a6 100644 --- a/site/Makefile +++ b/site/Makefile @@ -14,9 +14,7 @@ sapper: docker: @echo "\n~> building docker image" - @docker build . -t $(IMAGE) - @echo "\n~> pushing docker image" - @docker push $(IMAGE) + @gcloud builds submit -t $(IMAGE) deploy: sapper docker