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

View File

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