Files
trip-planner/Dockerfile
Vladimir Zagainov b14682f424 fix: address code review findings
- Create README.md with project overview, quick start, Docker deployment, CI/CD info
- Update CLAUDE.md with Deployment section
- Fix cmd/api/main.go to use REDIS_ADDR env var with fallback
- Fix Dockerfile to use golang:1.22-alpine instead of golang:1.26-alpine
- Fix .gitea/workflows/deploy.yml to include Docker registry prefix in image tags
2026-08-19 01:11:55 +03:00

39 lines
731 B
Docker

# Builder stage
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Copy go.mod and go.sum
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build api and cron binaries
RUN go build -o api ./cmd/api
RUN go build -o cron ./cmd/cron
# Runtime stage
FROM alpine:latest
WORKDIR /app
# Copy binaries from builder
COPY --from=builder /app/api /app/api
COPY --from=builder /app/cron /app/cron
# Set environment variables
ENV DB_DSN="postgres://postgres:postgres@postgres:5432/trip_planner?sslmode=disable"
ENV REDIS_ADDR="redis:6379"
ENV YANDEX_API_KEY=""
ENV TRIP_PLANNER_ADMIN_API_KEY=""
# Expose port
EXPOSE 8080
# Set entrypoint for api service (default)
ENTRYPOINT ["/app/api"]