Files
main-tbbank/backend/Dockerfile
2026-08-04 12:50:20 +05:00

32 lines
605 B
Docker
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/ash
# Specifies a parent image
FROM golang:1.26.4-alpine AS builder
# Creates an app directory to hold your app’s source code
WORKDIR /build
# Installs Go dependencies
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . .
# Builds your app with optional configuration
RUN GOARCH=amd64 GOOS=linux go build -o myapp ./app.go
FROM scratch
WORKDIR /app/
COPY --from=builder /build/myapp .
COPY --from=builder /build/config.yaml .
COPY --from=builder /build/web ./web
# Tells Docker which network port your container listens on
EXPOSE 5050
#ENTRYPOINT ["/app/myapp"]
CMD ["/app/myapp"]