TinySkin/Dockerfile
thehrz 03cbed8c62
Some checks are pending
CI / deploy (push) Waiting to run
feat: add Docker support
2024-11-09 17:41:36 +08:00

23 lines
454 B
Docker

FROM node:20-alpine AS frontend-stage
WORKDIR /app
RUN corepack enable
COPY frontend/package.json frontend/pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile
COPY frontend/ .
RUN pnpm build
FROM golang:1.23 as build-stage
WORKDIR /app
ENV GOPROXY https://goproxy.cn,direct
COPY --from=frontend-stage /app/dist ./server/static/files
COPY . .
RUN go build -o app .
CMD ["/app/app"]