Files
walkies/Dockerfile
James Griffin e82a39f2e4
All checks were successful
CI / Go tests & lint (push) Successful in 8s
CI / Frontend tests & type-check (push) Successful in 40s
CI / Go tests & lint (pull_request) Successful in 7s
CI / Frontend tests & type-check (pull_request) Successful in 35s
Fix build and run issues
2026-04-08 14:58:58 -03:00

26 lines
590 B
Docker

# Stage 1: Build React frontend
FROM node:22-alpine AS frontend
WORKDIR /app/web
COPY web/package*.json ./
RUN npm install
COPY web/ ./
RUN npm run build
# Stage 2: Build Go backend
FROM golang:1.26-alpine AS backend
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /walkies ./cmd/server
# Stage 3: Final image
FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=backend /walkies ./walkies
COPY --from=frontend /app/web/build ./web/dist
EXPOSE 8080
ENV STATIC_DIR=/app/web/dist
CMD ["./walkies"]