Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.git
.gitignore
.idea
.vscode

*.exe
*.test
*.out
coverage.out

.env
.env.*
!.env.example

README.md
30 changes: 30 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM golang:1.25-alpine AS builder

WORKDIR /src

RUN apk add --no-cache ca-certificates git

COPY go.mod go.sum ./
RUN go mod download

COPY . .
Comment thread
martian56 marked this conversation as resolved.
Comment thread
martian56 marked this conversation as resolved.

RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/api ./cmd/api

FROM alpine:3.21

RUN apk add --no-cache ca-certificates tzdata \
&& addgroup -S app && adduser -S app -G app

WORKDIR /app

COPY --from=builder /out/api ./api
COPY migrations ./migrations

USER app

ENV MIGRATIONS_PATH=/app/migrations
Comment thread
martian56 marked this conversation as resolved.

EXPOSE 8080

ENTRYPOINT ["/app/api"]
Loading