mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-06 03:57:54 +08:00
feat: add docker
This commit is contained in:
parent
dd66ec8e20
commit
542df18723
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@ -0,0 +1,8 @@
|
||||
/node_modules
|
||||
/.git
|
||||
/.gitignore
|
||||
/.vscode
|
||||
/.DS_Store
|
||||
/*.md
|
||||
/dist
|
||||
|
8
docker-compose.product.yml
Normal file
8
docker-compose.product.yml
Normal file
@ -0,0 +1,8 @@
|
||||
services:
|
||||
nove-admin:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/dockerfile.product
|
||||
container_name: nove-admin
|
||||
ports:
|
||||
- 80:80
|
23
docker/dockerfile.product
Normal file
23
docker/dockerfile.product
Normal file
@ -0,0 +1,23 @@
|
||||
FROM node:20-slim AS base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS prod-deps
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||
|
||||
FROM base AS builder
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
RUN pnpm run build
|
||||
|
||||
FROM nginx:1.23.1-alpine
|
||||
|
||||
WORKDIR /www
|
||||
|
||||
COPY --from=builder /app/dist/ .
|
||||
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
Loading…
x
Reference in New Issue
Block a user