add seed binary to Docker build and expose frontend port 80
This commit is contained in:
@@ -14,7 +14,8 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o api ./cmd/api
|
RUN CGO_ENABLED=0 GOOS=linux go build -o api ./cmd/api && \
|
||||||
|
CGO_ENABLED=0 GOOS=linux go build -o seed ./cmd/seed
|
||||||
|
|
||||||
# Stage 2: Production
|
# Stage 2: Production
|
||||||
FROM alpine:latest AS production
|
FROM alpine:latest AS production
|
||||||
@@ -25,6 +26,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Copy binary from builder
|
# Copy binary from builder
|
||||||
COPY --from=builder /app/api .
|
COPY --from=builder /app/api .
|
||||||
|
COPY --from=builder /app/seed .
|
||||||
|
|
||||||
# Copy migrations
|
# Copy migrations
|
||||||
COPY internal/db/migrations ./migrations
|
COPY internal/db/migrations ./migrations
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ services:
|
|||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: ${GITEA_REGISTRY}/delivery-tracker/frontend:latest
|
image: ${GITEA_REGISTRY}/delivery-tracker/frontend:latest
|
||||||
expose:
|
ports:
|
||||||
- "80"
|
- "80:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
Reference in New Issue
Block a user