-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
112 lines (107 loc) · 2.78 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
##version: "3.7"
name: app_backend
services:
## Contenedor para la base de datos
db:
image: mysql:5.7
container_name: db
restart: unless-stopped
ports:
- 3306:3306
environment:
MYSQL_DATABASE: "app_db"
MYSQL_ROOT_PASSWORD: "password_root"
MYSQL_USER: "admin"
MYSQL_PASSWORD: "password_admin"
SERVICE_TAGS: bd_app
SERVICE_NAME: mysql
volumes:
- ./data:/var/lib/mysql
networks:
- app-network
## Contenedor de la aplicacion del backend
app:
build:
args:
user: admin
uid: 1000
context: ./
dockerfile: Dockerfile
image: app
container_name: app
depends_on:
db:
condition: service_started
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./src:/var/www/html
- ./log/codeigniter:/var/www/html/writable/logs
##- ./conf/php:/usr/local/etc/php
networks:
- app-network
## Contenedor para el servicio web del backend
nginx:
image: nginx:stable-alpine3.17
container_name: web
depends_on:
app:
condition: service_started
restart: unless-stopped
ports:
- 80:80
# - 443:443
volumes:
- ./src:/var/www/html
# - ./certificado:/etc/nginx/ssl
- ./conf/nginx.conf:/etc/nginx/conf.d/default.conf
- ./log/nginx:/var/log/nginx
networks:
- app-network
## Contenedor para crear los respaldos del backend
periodic-backup:
build:
context: ./periodic-backup
container_name: backups
depends_on:
db:
condition: service_started
restart: always
environment:
## Nombre del contenedor de base de datos
MYSQL_CONTAINER_NAME: db
## Credenciales de conexion a base de datos para respaldo
MYSQL_DATABASE: app_db
MYSQL_ROOT_PASSWORD: "password_root"
volumes:
#- /etc/localtime:/etc/localtime:ro
## Rutas para guardar los respaldos del proyecto
- ./backup/data-base:/opt/mysql/backup
- ./backup/files:/home/backup/files
- ./backup/config:/home/backup/config
- ./backup/src:/home/backup/src
## Ruta de acceso a las carpetas y archivos del proyecto para respaldar
- .:/home/app-backend
command: crond -f -d 8
networks:
- app-network
## Contenedor para las tareas programadas del backend
cron-jobs:
build:
context: ./cron-jobs
container_name: cron-jobs
depends_on:
app:
condition: service_started
restart: always
#volumes:
## Volumenes de las carpetas que se utilicen las tareas programadas
#- /etc/localtime:/etc/localtime:ro
#- ./src/files/temp:/home/app-backend/pdfsTemp
command: crond -f -d 8
networks:
- app-network
## Red del backend
networks:
app-network:
driver: bridge