Use bind mount for dev container
This commit is contained in:
parent
ace6e50b73
commit
bc6c4ddde7
17
Dockerfile
17
Dockerfile
@ -1,18 +1,10 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM node:20-slim as base
|
FROM node:20-slim as base
|
||||||
|
|
||||||
ENV PNPM_HOME="/pnpm"
|
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
|
||||||
RUN corepack enable
|
|
||||||
|
|
||||||
WORKDIR /base
|
WORKDIR /base
|
||||||
COPY package.json pnpm-lock.yaml ./
|
|
||||||
RUN pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
|
|
||||||
# Development
|
# Local Development
|
||||||
FROM base AS dev
|
FROM base AS dev
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
CMD ["pnpm", "dev:next"]
|
CMD ["pnpm", "dev:next"]
|
||||||
@ -20,6 +12,13 @@ CMD ["pnpm", "dev:next"]
|
|||||||
|
|
||||||
# Production
|
# Production
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN corepack enable
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
COPY . .
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ services:
|
|||||||
- "MONGODB_URI=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongo:27017"
|
- "MONGODB_URI=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongo:27017"
|
||||||
volumes:
|
volumes:
|
||||||
- /base/media
|
- /base/media
|
||||||
|
- ./:/base
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
ports:
|
ports:
|
||||||
|
Loading…
Reference in New Issue
Block a user