New Filestructure for Docker

This commit is contained in:
2026-07-31 23:53:14 +02:00
parent 1e10ed4de8
commit 5bcf2a3546
239 changed files with 710 additions and 2000 deletions
+23 -93
View File
@@ -1,125 +1,55 @@
services:
nginx:
image: nginx:latest
container_name: wkvs-nginx
ports:
- "127.0.0.1:8080:80"
- "127.0.0.1:8082:8082"
volumes:
- .:/var/wkvs
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- "127.0.0.1:8081:80"
depends_on:
- apache
- node
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- wkvs
env-init:
build: ./config/apache
container_name: wkvs-env-init
volumes:
- .:/var/wkvs
working_dir: /var/wkvs
command: php setup/init-env.php
composer-init:
image: composer:latest
container_name: wkvs-composer-init
volumes:
- .:/app
working_dir: /app/composer
command: composer install --no-interaction --prefer-dist
depends_on:
env-init:
condition: service_completed_successfully
- app-network
apache:
build: ./config/apache
container_name: wkvs-apache
build: ./docker/apache
volumes:
- .:/var/wkvs
- ./config/apache/php/custom.ini:/usr/local/etc/php/conf.d/custom.ini
depends_on:
db-init:
condition: service_completed_successfully
composer-init:
condition: service_completed_successfully
- .:/var/www/wkvs
networks:
- wkvs
- app-network
mariadb:
image: mariadb:latest
container_name: wkvs-mariadb
image: mariadb:11
container_name: test-mariadb
restart: unless-stopped
env_file:
- path: ./config/.env.db
required: false
- ./config/.env.docker.db
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-h", "127.0.0.1"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
env-init:
condition: service_completed_successfully
networks:
- wkvs
- app-network
db-init:
build: ./config/apache
container_name: wkvs-db-init
node:
build:
context: .
dockerfile: docker/node/Dockerfile
expose:
- "8082"
volumes:
- .:/var/wkvs
working_dir: /var/wkvs
depends_on:
mariadb:
condition: service_healthy
env-init:
condition: service_completed_successfully
- .:/var/www/wkvs
- /var/www/wkvs/websocket/node_modules
networks:
- wkvs
command: php setup/database/init-db.php
- app-network
redis:
image: redis:7
container_name: wkvs-redis
restart: unless-stopped
env_file:
- path: ./config/.env.redis
required: false
command: ["sh", "-c", "exec redis-server --requirepass \"$REDDIS_PASSWORD\""]
depends_on:
env-init:
condition: service_completed_successfully
networks:
- wkvs
node:
image: node:latest
container_name: wkvs-node
restart: unless-stopped
volumes:
- .:/var/wkvs
working_dir: /var/wkvs/websocket
env_file:
- path: ./config/.env.redis
required: false
environment:
- REDDIS_HOST=redis
command: sh -c "npm install && npm install -g pm2 && pm2-runtime start index.js --max-memory-restart 1G --node-args=\"--max-old-space-size=1024\" --name=\"WebSocket WKVS\""
depends_on:
redis:
condition: service_started
env-init:
condition: service_completed_successfully
networks:
- wkvs
- app-network
volumes:
db_data:
networks:
wkvs:
app-network:
driver: bridge