Attempt 1
This commit is contained in:
31
AppServer/Dockerfile
Executable file
31
AppServer/Dockerfile
Executable file
@@ -0,0 +1,31 @@
|
||||
# [0] Go build environment
|
||||
FROM golang:1.24.5-alpine3.21 AS builder
|
||||
WORKDIR /app-server/src
|
||||
|
||||
## Dependencies
|
||||
# Get
|
||||
COPY ./src/go.mod ./src/go.sum ./
|
||||
# Download
|
||||
RUN go mod download
|
||||
|
||||
## Executable
|
||||
# Get
|
||||
COPY ./src .
|
||||
# Build
|
||||
RUN go build -o ../build/app_server
|
||||
|
||||
# [1] Final image -> new FS
|
||||
FROM alpine:latest
|
||||
WORKDIR /root/
|
||||
|
||||
# RUN apk add --no-cache ca-certificates
|
||||
# RUN apk add --no-cache bash
|
||||
|
||||
## Final build
|
||||
# Get
|
||||
COPY --from=builder /app-server/build ./build
|
||||
COPY ./certs ./certs
|
||||
COPY ./*.env ./build/
|
||||
|
||||
# Run the app
|
||||
CMD ["./build/app_server"]
|
||||
Reference in New Issue
Block a user