diff --git a/Dockerfile b/Dockerfile index c97aa3606..1a5759599 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 000000000..2ec3ff8c4 --- /dev/null +++ b/cloudbuild.yaml @@ -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'] + +