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.
26 lines
650 B
Docker
26 lines
650 B
Docker
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 golang:1.18-alpine AS backend-builder
|
|
WORKDIR /backend
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download -x
|
|
COPY . .
|
|
RUN go build -buildvcs=false -o website-server -v .
|
|
|
|
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 ./.env ./.env
|
|
EXPOSE 8000
|
|
CMD ["./website-server"]
|