Skip to content

Commit

Permalink
Merge pull request #7 from sapawarga/config-docker
Browse files Browse the repository at this point in the history
#6 create dockerfile and docker-compose file
  • Loading branch information
setiadijoe authored Jun 30, 2021
2 parents 94f85ac + b7eb24d commit 97f0f95
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
# Dependency directories (remove the comment below to include it)
# vendor/

.vscode
.vscode
auth-service
.env
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM registry.digitalservice.id/proxyjds/library/golang:1.15-alpine3.12 AS compile-image

RUN apk --no-cache add gcc g++ make ca-certificates git
# Set necessary environmet variables needed for our image
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64

WORKDIR /build

COPY go.mod .
COPY go.sum .
RUN go mod download -x

COPY . .

RUN CGO_ENABLED=0 go test -v ./...
RUN make build

FROM gcr.io/distroless/base-debian10

LABEL maintainer="GoSapawarga <[email protected]>"

COPY --from=compile-image /build /

ENTRYPOINT [ "/auth-service" ]
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'
services:
app:
build:
context: ./

networks:
- internal

env_file:
- .env
ports:
- 9007:9007

volumes:
- vol_mysql_data:/var/lib/mysql

networks:
internal:
driver: bridge

volumes:
vol_storage:
driver: local
vol_mysql_data:
driver: local

0 comments on commit 97f0f95

Please sign in to comment.