first commit
This commit is contained in:
25
backend/Dockerfile
Normal file
25
backend/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM golang:1.25-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod ./
|
||||
RUN apk add --no-cache build-base
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -o /bin/mira-api ./cmd/api
|
||||
|
||||
FROM alpine:3.21
|
||||
|
||||
RUN addgroup -S mira && adduser -S mira -G mira
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /bin/mira-api /usr/local/bin/mira-api
|
||||
COPY --from=build /app/migrations /app/migrations
|
||||
RUN mkdir -p /var/lib/mira/uploads && chown -R mira:mira /var/lib/mira
|
||||
|
||||
USER mira
|
||||
ENV GODEBUG=netdns=cgo
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["mira-api"]
|
||||
Reference in New Issue
Block a user