added .\dockerfile[deploy]
Some checks failed
Deploy Discord Bot / deploy (push) Failing after 40s

This commit is contained in:
Pascal Prießnitz
2025-12-03 01:41:52 +01:00
parent a21f349c00
commit 352217a17b
2 changed files with 32 additions and 5 deletions

View File

@@ -2,18 +2,24 @@ version: "3.9"
services:
app:
image: node:18
build:
context: . # Repo-Root (da, wo Dockerfile & package.json liegen)
dockerfile: Dockerfile
image: papo-app:latest
working_dir: /usr/src/app
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
env_file:
- .env
command: sh -c "npm install && npm run dev"
command: sh -c "npm run dev"
ports:
- "3000:3000"
depends_on:
- db
restart: unless-stopped
# WICHTIG: Für Production KEINE Source-Mounts,
# sonst überschreibst du das Image wieder mit einem leeren Verzeichnis.
# volumes:
# - .:/usr/src/app
# - /usr/src/app/node_modules
db:
image: postgres:15

21
dockerfile Normal file
View File

@@ -0,0 +1,21 @@
# Nutze Node 18 wie bisher
FROM node:18-alpine
# Arbeitsverzeichnis
WORKDIR /usr/src/app
# package.json und lockfile zuerst kopieren (für besseres Caching)
COPY package*.json ./
# Dependencies installieren (für Prod ggf. ohne devDependencies)
RUN npm ci --omit=dev
# Restlichen Code kopieren
COPY . .
# Wenn du TypeScript o.ä. builden musst, hier:
# RUN npm run build
# Start-Kommando anpassen, je nachdem was du hast
# z.B. "start" oder "dev"
CMD ["npm", "run", "dev"]