Added docker on backend

This commit is contained in:
Patrick Alvin Alcala 2025-10-21 11:43:04 +08:00
parent 9ecd74a82d
commit efe26cc454
2 changed files with 22 additions and 0 deletions

13
backend/Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM golang:1.25.3 AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GOOS=linux GOARCH=amd64 go build -pgo=auto -ldflags="-s -w" -o bin/esign-server main.go
FROM alpine:latest
WORKDIR /app
COPY --from=build /app/bin/esign-server .
EXPOSE 4320
CMD ["./esign-server"]

View file

@ -0,0 +1,9 @@
services:
e-sign-server:
container_name: e-sign-server
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
ports:
- 4320:4320