Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
chore(docker): add Dockerfile for go
Browse files Browse the repository at this point in the history
- add docker file for go

#3
  • Loading branch information
Leo Breuer committed Jul 22, 2023
1 parent ebd5727 commit 19b9c94
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
FROM python:alpine
FROM golang:1.20.6 as build
WORKDIR /app
RUN apk add git
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "main.py"]
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /service


FROM alpine:latest
WORKDIR /app
COPY --from=build /service /app/service
ENV JWT_SECRET="unsecure"
ENV PEPPER="thisispepper"
ENV DB_HOST="localhost"
ENV DB_PORT=5432
ENV DB_USER="miauw"
ENV DB_PASS="password"
ENV DB_NAME="miauw"
ENV REDIS_HOST="localhost"
ENV REDIS_PORT=6379
ENV REDIS_PASS=""
CMD ["/app/service"]


0 comments on commit 19b9c94

Please sign in to comment.