Skip to content

Commit

Permalink
Merge pull request #3 from JJ-Intelligence/deployment-setup-2
Browse files Browse the repository at this point in the history
Updated dockerfile and added deployment file
  • Loading branch information
josh-hook authored Jun 19, 2021
2 parents ca0bcb8 + 3421b7d commit c6a71f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ services:
volumes:
- '.:/sr-games-backend'
ports:
- '8081:8081'
expose:
- '8081'
- '8080:8080'
7 changes: 7 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c6a71f0

Please sign in to comment.