feat: add global proxy config upgrade: upgrade front(angular) to 19 chore: deployment staff 1. Dockerfile: build frontend, backend, and run in nginx base image
33 lines
656 B
Docker
33 lines
656 B
Docker
FROM node:lts AS fronter
|
|
|
|
WORKDIR /build/front
|
|
COPY front /build/front
|
|
RUN npm i --registry https://registry.npmmirror.com
|
|
RUN npm run build
|
|
|
|
FROM golang:latest AS builder
|
|
|
|
ENV GO111MODULE on
|
|
ENV CGO_ENABLED 0
|
|
ENV GOOS linux
|
|
ENV GOPROXY https://goproxy.io
|
|
|
|
WORKDIR /build
|
|
|
|
COPY . .
|
|
|
|
RUN go mod download
|
|
RUN go build -ldflags '-s -w' -o server .
|
|
|
|
FROM nginx:alpine
|
|
|
|
ENV TZ Asia/Shanghai
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /build/server /app/server
|
|
COPY --from=builder /build/deployment/nginx.conf /etc/nginx/nginx.conf
|
|
COPY --from=builder /build/deployment/endpoint.sh /app
|
|
COPY --from=fronter /build/front/dist /app/dist
|
|
|
|
ENTRYPOINT [ "/app/endpoint.sh" ] |