101 lines
2.0 KiB
YAML
101 lines
2.0 KiB
YAML
services:
|
|
caddy:
|
|
image: caddy:alpine
|
|
container_name: caddy
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile # Monta el archivo de configuración
|
|
- caddy_data:/data # Almacena los certificados en este volumen
|
|
- caddy_config:/config # Configuración de Caddy
|
|
- shared_frontend:/srv
|
|
ports:
|
|
- 80:80 # Puerto HTTP (Caddy lo redirige automáticamente a HTTPS)
|
|
- 443:443 # Puerto HTTPS
|
|
- 13001:13001
|
|
networks:
|
|
- reverse_proxy
|
|
#depends_on:
|
|
# - backend
|
|
|
|
mariadb:
|
|
env_file: "stack.env"
|
|
image: mariadb:latest
|
|
container_name: mariadb
|
|
#healthcheck:
|
|
# test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
|
# timeout: 20s
|
|
# retries: 10
|
|
ports:
|
|
- 3306:3306
|
|
volumes:
|
|
- mariadb_data:/var/lib/mysql
|
|
networks:
|
|
- private
|
|
|
|
wait-for-mariadb:
|
|
image: atkrad/wait4x
|
|
depends_on:
|
|
- mariadb
|
|
command: tcp mariadb:3306 -t 30s -i 250ms
|
|
networks:
|
|
- private
|
|
|
|
phpmyadmin:
|
|
env_file: "stack.env"
|
|
image: phpmyadmin/phpmyadmin
|
|
container_name: phpmyadmin
|
|
ports:
|
|
- 8080:80
|
|
networks:
|
|
- private
|
|
depends_on:
|
|
- mariadb
|
|
|
|
backend:
|
|
env_file: "stack.env"
|
|
build:
|
|
args:
|
|
- NODE_ENV=production
|
|
context: ./
|
|
dockerfile: Dockerfile.server
|
|
environment:
|
|
- NODE_ENV=production
|
|
volumes:
|
|
- backend_logs:/var/log
|
|
ports:
|
|
- 3001:3001
|
|
networks:
|
|
- private
|
|
- reverse_proxy
|
|
depends_on:
|
|
wait-for-mariadb:
|
|
condition: service_completed_successfully
|
|
restart: on-failure
|
|
|
|
frontend:
|
|
env_file: "stack.env"
|
|
build:
|
|
args:
|
|
- NODE_ENV=production
|
|
context: ./
|
|
dockerfile: Dockerfile.client
|
|
environment:
|
|
- NODE_ENV=production
|
|
volumes:
|
|
- shared_frontend:/www/client/dist
|
|
networks:
|
|
- reverse_proxy
|
|
depends_on:
|
|
- backend
|
|
restart: on-failure
|
|
|
|
volumes:
|
|
shared_frontend:
|
|
caddy_data:
|
|
caddy_config:
|
|
mariadb_data:
|
|
backend_logs:
|
|
|
|
networks:
|
|
private:
|
|
reverse_proxy:
|