Files
ng-blog/Dockerfile
u80864958 ca99d8fb87
All checks were successful
Release / publish (push) Successful in 4m11s
actually fix dockerfile
2025-05-05 11:31:37 +02:00

46 lines
712 B
Docker

FROM node:22-alpine AS build-frontend
WORKDIR /app
COPY web/package*.json ./
RUN npm install
RUN npm install -g @angular/cli
COPY web .
RUN ng build --configuration=production
RUN ls -R dist
FROM golang:1.24-alpine AS build-backend
RUN apk add --no-cache --update gcc g++
WORKDIR /usr/src/app
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
RUN mkdir -p /web/dist/frontend/browser
COPY . .
COPY --from=build-frontend /app/dist/frontend/browser /usr/src/app/web/dist/frontend/browser
ENV CGO_ENABLED=1
RUN go build -o=ng-blog cmd/main.go
FROM alpine:latest
WORKDIR /
COPY --from=build-backend /usr/src/app/ng-blog /ng-blog
EXPOSE 8080
ENTRYPOINT ["/ng-blog", "serve"]