updated .\dockerfile[deploy]
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 1m1s

This commit is contained in:
Pascal Prießnitz
2025-12-03 02:08:24 +01:00
parent d28a62a2f8
commit a3c8e377c9
2 changed files with 9 additions and 12 deletions

View File

@@ -3,7 +3,7 @@ version: "3.9"
services:
app:
build:
context: . # Repo-Root (da, wo Dockerfile & package.json liegen)
context: . # Repo-Root mit Dockerfile & package.json
dockerfile: Dockerfile
image: papo-app:latest
working_dir: /usr/src/app
@@ -15,8 +15,7 @@ services:
depends_on:
- db
restart: unless-stopped
# WICHTIG: Für Production KEINE Source-Mounts,
# sonst überschreibst du das Image wieder mit einem leeren Verzeichnis.
# WICHTIG: KEINE volumes hier!
# volumes:
# - .:/usr/src/app
# - /usr/src/app/node_modules

View File

@@ -1,27 +1,25 @@
# Node 22 auf Debian-Basis (glibc, nicht alpine/musl)
FROM node:22-bookworm
# System-Pakete für native Module (@discordjs/opus, node-gyp, etc.)
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Arbeitsverzeichnis
WORKDIR /usr/src/app
# package.json & lockfile zuerst kopieren (für Caching)
COPY package*.json ./
# Dependencies installieren (Prod ohne devDependencies, wenn du das willst)
# Alle Dependencies inkl. dev installieren
RUN npm ci
# Restlichen Code kopieren
# OPTIONAL, aber hilfreich: global ts-node-dev installieren,
# damit der Befehl IMMER verfügbar ist, auch wenn node_modules-mal zickt
RUN npm install -g ts-node-dev
COPY . .
# Wenn du TypeScript oder ein Build-Skript hast:
# RUN npm run build
# Kleine Debug-Zeile: zeigt dir im Build-Log, dass ts-node-dev im PATH ist
RUN ts-node-dev --version || echo "ts-node-dev not in PATH?!"
# Startkommando bei dir scheinst du dev zu nutzen
CMD ["npm", "run", "dev"]