add ui/dist to .gitignore. change dockerfile to build front.

This commit is contained in:
Roy
2024-10-20 04:51:06 +08:00
parent 467e4c4634
commit 57ae6d5b40
31 changed files with 34 additions and 436 deletions

View File

@@ -1,11 +1,24 @@
FROM golang:1.22-alpine as builder
FROM node:20-alpine3.19 AS front-builder
WORKDIR /app
COPY . /app/
RUN \
cd /app/ui && \
npm install && \
npm run build
FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY ../. /app/
RUN go build -o certimate
RUN rm -rf /app/ui/dist
COPY --from=front-builder /app/ui/dist /app/ui/dist
RUN go build -o certimate
FROM alpine:latest