Merge pull request #2479 from sveltejs/gcloud-builds

site: use gcloud CLI to build Docker image
pull/2481/head
Rich Harris 6 years ago committed by GitHub
commit 8e1fa5755f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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:11.14
# 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-11.14
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