mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-05 06:34:12 +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
|
FROM debian:11
|
||||||
ENV PNPM_HOME="/pnpm"
|
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
|
||||||
RUN corepack enable
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apt-get update
|
||||||
FROM base AS prod-deps
|
RUN apt-get install -y wget curl make sudo unzip
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||||
|
RUN apt-get install -y nodejs
|
||||||
FROM base AS build
|
RUN npm i -g pnpm
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
RUN pnpm install
|
||||||
RUN pnpm run build
|
EXPOSE 9527
|
||||||
|
|
||||||
FROM base
|
|
||||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
|
||||||
COPY --from=build /app/dist /app/dist
|
|
||||||
EXPOSE 3000
|
|
||||||
CMD [ "pnpm", "dev" ]
|
CMD [ "pnpm", "dev" ]
|
||||||
|
@ -8,7 +8,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "9527:9527"
|
||||||
# if you want to persist
|
# if you want to persist
|
||||||
# volumes:
|
# volumes:
|
||||||
# - ./app:/app
|
# - ./app:/app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user