From 3421b7d1d423b81e19775a676aa1162f0428619a Mon Sep 17 00:00:00 2001 From: Josh Hook Date: Sat, 19 Jun 2021 17:38:18 +0100 Subject: [PATCH] Updated dockerfile and added deployment file --- Dockerfile | 6 +++--- docker-compose.yaml | 4 +--- scripts/deploy.sh | 7 +++++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ba1b75b..4c42138 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,9 +19,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o backend.exe cmd/main.go # Create production image FROM scratch COPY --from=builder /sr-games-backend/backend.exe /backend.exe -ENV PORT 8081 -EXPOSE 8081 -CMD ["./backend.exe", "8081"] +ENV PORT 8080 +EXPOSE 8080 +CMD ["./backend.exe"] #FROM alpine #RUN apk add --no-cache ca-certificates diff --git a/docker-compose.yaml b/docker-compose.yaml index e70dc0d..e0ce119 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,6 +9,4 @@ services: volumes: - '.:/sr-games-backend' ports: - - '8081:8081' - expose: - - '8081' + - '8080:8080' diff --git a/scripts/deploy.sh b/scripts/deploy.sh index e69de29..6b14c58 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -0,0 +1,7 @@ +export PROJECT_ID=jjgames +export TAG=v1 +docker build -f Dockerfile -t gcr.io/$PROJECT_ID/sr-games-backend:$TAG . +gcloud services enable containerregistry.googleapis.com +gcloud auth configure-docker +docker push gcr.io/$PROJECT_ID/sr-games-backend:$TAG +read \ No newline at end of file