You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/Dockerfile

29 lines
745 B
Docker

FROM node:18-alpine AS frontend-builder
RUN apk add make
WORKDIR /_frontend
RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
COPY ./_frontend/pnpm-lock.yaml ./
RUN pnpm fetch --prod
COPY ./_frontend ./
RUN pnpm install -r --offline --prod
RUN make build
FROM golang:1.19-alpine AS backend-builder
RUN apk add make
WORKDIR /backend
COPY go.mod go.sum ./
RUN go mod download -x
COPY ./ ./
RUN make backend
FROM alpine:latest AS runner
WORKDIR /app
COPY --from=frontend-builder /_frontend/out ./_frontend/out
COPY --from=backend-builder /backend/phc-website-server ./phc-website-server
COPY ./_views ./_views
COPY ./_content/news ./_content/news
COPY ./_public ./_public
2 years ago
COPY ./.env ./.env
EXPOSE 8000
CMD ["./website-server"]