feat: SPA build + serving im Dockerfile und server.ts
Some checks failed
Deploy Discord Bot / deploy (push) Has been cancelled
Some checks failed
Deploy Discord Bot / deploy (push) Has been cancelled
This commit is contained in:
18
dockerfile
18
dockerfile
@@ -12,20 +12,30 @@ ENV PATH="/usr/src/app/node_modules/.bin:${PATH}"
|
||||
ENV DATABASE_URL=postgresql://user:pass@localhost:5432/papo?schema=public
|
||||
ENV PRISMA_IGNORE_ENV_LOAD=true
|
||||
|
||||
# Install dependencies (inkl. dev)
|
||||
# Install backend dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm ci --include=dev
|
||||
|
||||
# Ensure prisma CLI available globally (avoids path issues)
|
||||
RUN npm install -g prisma@5.4.2
|
||||
# Install frontend dependencies
|
||||
COPY frontend/package*.json ./frontend/
|
||||
RUN npm --prefix frontend ci
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build:web
|
||||
|
||||
# Ensure prisma CLI available globally (avoids path issues)
|
||||
RUN npm install -g prisma@5.4.2
|
||||
|
||||
# Generate Prisma client (explicit schema path)
|
||||
RUN prisma generate --schema=src/database/schema.prisma
|
||||
|
||||
# Build backend
|
||||
RUN npm run build
|
||||
|
||||
# Optional: show versions in build log
|
||||
RUN node -v && npm -v && npx prisma -v
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
CMD ["npm", "start"]
|
||||
|
||||
Reference in New Issue
Block a user