Add Dockerfile and .dockerignore for containerization
This commit is contained in:
parent
fbc7562040
commit
edf57baccf
|
|
@ -0,0 +1,15 @@
|
|||
.git
|
||||
.vscode
|
||||
.env
|
||||
cache.txt
|
||||
logs.txt
|
||||
Untitled-1.txt
|
||||
*.p12
|
||||
*.json
|
||||
*.exe
|
||||
# Go build cache and modules
|
||||
/tmp
|
||||
**/tmp
|
||||
*.out
|
||||
*.test
|
||||
vendor/
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
# --- Build stage ---
|
||||
FROM golang:1.24 as builder
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o iralex-einvoice main.go
|
||||
|
||||
# --- Run stage ---
|
||||
FROM gcr.io/distroless/base-debian12
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/iralex-einvoice ./iralex-einvoice
|
||||
COPY --from=builder /app/.env.example ./.env.example
|
||||
# If you want to provide a default .env, uncomment the next line:
|
||||
# COPY --from=builder /app/.env ./.env
|
||||
# Copy any static files or certs if needed (uncomment and adjust as needed)
|
||||
# COPY --from=builder /app/static ./static
|
||||
# COPY --from=builder /app/certs ./certs
|
||||
|
||||
# Expose the default port (can be overridden by env or flag)
|
||||
EXPOSE 1404
|
||||
|
||||
# Entrypoint
|
||||
ENTRYPOINT ["/app/iralex-einvoice"]
|
||||
Loading…
Reference in New Issue