Still refactoring, better _frontend and _public structuring
This commit is contained in:
+18
-15
@@ -1,25 +1,28 @@
|
||||
FROM node:18 AS frontend-builder
|
||||
WORKDIR /frontend
|
||||
COPY ./frontend/package.json ./package.json
|
||||
COPY ./frontend/package-lock.json ./package-lock.json
|
||||
RUN npm install
|
||||
COPY ./frontend .
|
||||
RUN make
|
||||
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.18-alpine AS backend-builder
|
||||
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 go build -buildvcs=false -o website-server -v .
|
||||
COPY ./ ./
|
||||
RUN make backend
|
||||
|
||||
FROM alpine:latest AS runner
|
||||
WORKDIR /app
|
||||
COPY --from=frontend-builder /frontend/dist ./frontend/dist
|
||||
COPY --from=backend-builder /backend/website-server ./website-server
|
||||
COPY ./views ./views
|
||||
COPY ./news ./news
|
||||
COPY ./public ./public
|
||||
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
|
||||
COPY ./.env ./.env
|
||||
EXPOSE 8000
|
||||
CMD ["./website-server"]
|
||||
|
||||
Reference in New Issue
Block a user