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.
25 lines
609 B
Docker
25 lines
609 B
Docker
2 years ago
|
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 / ./website-server
|
||
|
COPY ./views ./views
|
||
|
COPY ./news ./news
|
||
|
COPY ./public ./public
|
||
|
EXPOSE 8000
|
||
|
CMD ["./website-server"]
|