Template
1
0
Fork 0

Docker-ify?

This commit is contained in:
Atridad Lahiji 2024-05-14 00:00:28 -06:00
parent 44df2533c8
commit a4b34d4943
No known key found for this signature in database
2 changed files with 25 additions and 0 deletions

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM golang:1.22.0 as build
WORKDIR /app
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /go/bin/app
FROM gcr.io/distroless/base-debian12
COPY --from=build /go/bin/app /
CMD [ "/app" ]

11
docker-compose.yml Normal file
View file

@ -0,0 +1,11 @@
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
image: your-app-image:latest
command: ["/app"]
ports:
- "3000:3000"