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
|
||||
FROM node:20-slim as base
|
||||
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
|
||||
WORKDIR /base
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
|
||||
|
||||
# Development
|
||||
# Local Development
|
||||
FROM base AS dev
|
||||
ENTRYPOINT []
|
||||
CMD ["pnpm", "dev:next"]
|
||||
@ -20,6 +12,13 @@ CMD ["pnpm", "dev:next"]
|
||||
|
||||
# Production
|
||||
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
|
||||
RUN pnpm build
|
||||
|
||||
|
@ -19,6 +19,7 @@ services:
|
||||
- "MONGODB_URI=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongo:27017"
|
||||
volumes:
|
||||
- /base/media
|
||||
- ./:/base
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
|
Loading…
Reference in New Issue
Block a user