nochmal, nun alles docker-zeugs dabei

This commit is contained in:
rxf
2025-11-23 12:28:41 +01:00
parent 6727fe91d9
commit 268b4dee18
8 changed files with 96 additions and 2 deletions

3
backend/.env.docker Normal file
View File

@@ -0,0 +1,3 @@
# Environment variables for Docker Compose
MONGO_ROOT_USER=root
MONGO_ROOT_PASSWD=SFluorit

18
backend/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Expose the application port
EXPOSE 3001
# Start the application
CMD ["npm", "run", "dev"]

View File

@@ -12,7 +12,48 @@ services:
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
networks:
- app-network
backend:
build:
context: .
dockerfile: Dockerfile
container_name: backend
restart: unless-stopped
ports:
- "3001:3001"
environment:
- PORT=3001
- MONGO_URI=mongodb://${MONGO_ROOT_USER}:${MONGO_ROOT_PASSWD}@mongodb:27017/appointmentsdb?authSource=admin
depends_on:
- mongodb
volumes:
- ./src:/app/src
- ./package.json:/app/package.json
networks:
- app-network
frontend:
build:
context: ../frontend
dockerfile: Dockerfile
container_name: frontend
restart: unless-stopped
ports:
- "5173:5173"
depends_on:
- backend
volumes:
- ../frontend/src:/app/src
- ../frontend/package.json:/app/package.json
networks:
- app-network
volumes:
mongodb_data:
mongodb_config:
mongodb_config:
networks:
app-network:
driver: bridge