site: use gcloud CLI to build Docker image

pull/2479/head
Conduitry 5 years ago
parent a8832f006e
commit 8866e5a219

@ -0,0 +1,9 @@
/*
!/Dockerfile
!/package.json
!/package-lock.json
!/__sapper__
/__sapper__/*
!/__sapper__/build
!/static
!/content

@ -0,0 +1 @@
#!include:.dockerignore

@ -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"]

@ -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

Loading…
Cancel
Save