Added docker file
parent
dc53ee66cb
commit
cb76d0cdf2
@ -0,0 +1,24 @@
|
|||||||
|
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"]
|
Loading…
Reference in New Issue