mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-04 22:28:40 +08:00
修复docker
This commit is contained in:
parent
416fbd7990
commit
3767861fe4
24
Dockerfile
24
Dockerfile
@ -1,19 +1,11 @@
|
||||
FROM node:18-alpine AS base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
FROM debian:11
|
||||
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 build
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
RUN pnpm run build
|
||||
|
||||
FROM base
|
||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/dist /app/dist
|
||||
EXPOSE 3000
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y wget curl make sudo unzip
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||
RUN apt-get install -y nodejs
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm install
|
||||
EXPOSE 9527
|
||||
CMD [ "pnpm", "dev" ]
|
||||
|
@ -8,7 +8,7 @@ services:
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "9527:9527"
|
||||
# if you want to persist
|
||||
# volumes:
|
||||
# - ./app:/app
|
||||
|
Loading…
x
Reference in New Issue
Block a user