-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 724 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (27 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Build stage
FROM golang:1.26.1-alpine AS builder
RUN apk add --no-cache git make gcc musl-dev
WORKDIR /app
# Copy go mod and sum files first to leverage caching
COPY go.mod go.sum ./
RUN go mod download
# Copy the source code
COPY . .
# Build the binary
RUN make prod APP_ENV=prod
# Run stage
FROM alpine:latest
RUN apk add --no-cache ca-certificates
WORKDIR /app
# Copy the binary from the build stage
COPY --from=builder /app/build/meissa .
# Copy config files
COPY --from=builder /app/configs ./configs
# Ensure the binary is executable
RUN chmod +x /app/meissa
# Expose the server port
EXPOSE 8080
# Environment variables
ENV APP_ENV=prod
# Command to run the application
ENTRYPOINT ["./meissa", "serve"]