Skip to content
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
# docker exec -ti --user root alpine_timeoff /bin/sh
# --------------------------------------------------------------------
FROM alpine:latest as dependencies
RUN apk upgrade
RUN apk update

RUN apk add --no-cache \
nodejs npm

COPY package.json .
RUN npm install
RUN npm install -g npm

FROM alpine:latest

Expand All @@ -35,8 +37,7 @@ RUN adduser --system app --home /app
USER app
WORKDIR /app
COPY . /app
COPY --from=dependencies node_modules ./node_modules
#COPY --from=dependencies node_modules ./node_modules

CMD npm start

EXPOSE 3000
17 changes: 17 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'us-central1-docker.pkg.dev/gorilla-375616/time-off-gorilla/time-off-image:latest', '.' ]
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args:
- '-c'
- >
gcloud deploy releases create release-$BUILD_ID
--delivery-pipeline=time-off-app
--region=us-central1
--source=./
--images=image1=us-central1-docker.pkg.dev/gorilla-375616/time-off-gorilla/time-off-image:latest

images: ['us-central1-docker.pkg.dev/gorilla-375616/time-off-gorilla/time-off-image:latest']