Files
web-hosts/chuckie.coppertone.tech/app/Dockerfile.api.dev
2025-12-26 13:38:04 +01:00

25 lines
617 B
Docker

FROM docker.io/library/golang:1.25-bookworm
WORKDIR /app
# Install wgo for live reloading with retry logic
RUN for i in 1 2 3 4 5; do \
echo "Attempt $i to install wgo..." && \
go install github.com/bokwoon95/wgo@latest && break || \
(echo "Install failed, retrying in 5s..." && sleep 5); \
done
# Copy module files first for caching
COPY server-go/go.mod server-go/go.sum ./server-go/
WORKDIR /app/server-go
RUN go mod download
# Copy the rest of the source
COPY server-go/ .
# Expose port
EXPOSE 4000
ENV PORT=4000
# Run app directly for stability test
CMD ["go", "run", "main.go"]