Use bind mount for dev container

This commit is contained in:
tobias 2024-06-23 10:32:21 +02:00
parent ace6e50b73
commit bc6c4ddde7
2 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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: