Commit 9bdbb687a0854d5a0f76ff1d06ba7ebd31ce172d
1 parent
f44d4912
Exists in
dev
re-enabling previous version of docker-compose, adding new docker-compose file w…
…ith two pyros services
Showing
2 changed files
with
104 additions
and
37 deletions
Show diff stats
docker/docker-compose.yml
... | ... | @@ -56,43 +56,6 @@ services: |
56 | 56 | #ipv4_address: "${IP_PYROS_USER}" |
57 | 57 | restart: always |
58 | 58 | |
59 | - pyros2: | |
60 | - # path to the Dockerfile of this image | |
61 | - build: | |
62 | - context: .. | |
63 | - dockerfile: Dockerfile-django2 | |
64 | - container_name: pyros2 | |
65 | - # tty is the -t option in docker exec | |
66 | - tty: true | |
67 | - # stdin_open is the -i option in docker exec | |
68 | - stdin_open: true | |
69 | - env_file: | |
70 | - - variables.env | |
71 | - environment: | |
72 | - # environment variables only for Docker | |
73 | - - WITH_DOCKER=y | |
74 | - - MYSQL_ROOT_LOGIN=root | |
75 | - - MYSQL_TCP_PORT=3306 | |
76 | - # environment variables available for both Docker usage and non Docker usage | |
77 | - - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}" | |
78 | - - "MYSQL_PYROS_LOGIN=${MYSQL_PYROS_LOGIN:-pyros}" | |
79 | - - "MYSQL_PYROS_PWD=${MYSQL_PYROS_PWD:-DjangoPyros}" | |
80 | - - PYROS_WEBSITE_PORT=8002 | |
81 | - #- "IP_PYROS_USER=${IP_PYROS_USER:-172.28.1.5}" | |
82 | - volumes: | |
83 | - - ..:/home/pyros_user/app | |
84 | - # tells which port of local machine can communicate with the docker image (host:container), host is your local machine | |
85 | - ports: | |
86 | - - 8002:8002 | |
87 | - # starting db service before install service | |
88 | - depends_on: | |
89 | - - db | |
90 | - # create network to allow images to communicate with other images within the same network | |
91 | - networks: | |
92 | - - pyros-network | |
93 | - #ipv4_address: "${IP_PYROS_USER}" | |
94 | - restart: always | |
95 | - | |
96 | 59 | # declaring volumes |
97 | 60 | volumes: |
98 | 61 | db: | ... | ... |
... | ... | @@ -0,0 +1,104 @@ |
1 | +version: "3.9" | |
2 | + | |
3 | +services: | |
4 | + db: | |
5 | + # if we're using mysql >= 8, some of sql queries aren't valid anymore, like for creating and grant an user at the same time | |
6 | + image: mysql:5.7.22 | |
7 | + command: --default-authentication-plugin=mysql_native_password | |
8 | + restart: always | |
9 | + container_name: db_pyros | |
10 | + environment: | |
11 | + # note : as db is an image of mysql, this root password will be set on the first installation on the image, if the value is changed, it will not be updated in the database | |
12 | + - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}" | |
13 | + volumes: | |
14 | + - db:/var/lib/mysql/ | |
15 | + # create network to allow images to communicate with other images within the same network | |
16 | + networks: | |
17 | + - pyros-network | |
18 | + healthcheck: | |
19 | + test: ["CMD", 'mysqladmin', 'ping', '-h', 'db', '-u', 'root', '-p$$MYSQL_ROOT_PASSWORD' ] | |
20 | + timeout: 10s | |
21 | + interval: 5s | |
22 | + retries: 20 | |
23 | + | |
24 | + # service image of python, that let users to interact with python scripts such as pyros. | |
25 | + pyros: | |
26 | + # path to the Dockerfile of this image | |
27 | + build: .. | |
28 | + container_name: pyros | |
29 | + # tty is the -t option in docker exec | |
30 | + tty: true | |
31 | + # stdin_open is the -i option in docker exec | |
32 | + stdin_open: true | |
33 | + env_file: | |
34 | + - variables.env | |
35 | + environment: | |
36 | + # environment variables only for Docker | |
37 | + - WITH_DOCKER=y | |
38 | + - MYSQL_ROOT_LOGIN=root | |
39 | + - MYSQL_TCP_PORT=3306 | |
40 | + # environment variables available for both Docker usage and non Docker usage | |
41 | + - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}" | |
42 | + - "MYSQL_PYROS_LOGIN=${MYSQL_PYROS_LOGIN:-pyros}" | |
43 | + - "MYSQL_PYROS_PWD=${MYSQL_PYROS_PWD:-DjangoPyros}" | |
44 | + #- "IP_PYROS_USER=${IP_PYROS_USER:-172.28.1.5}" | |
45 | + volumes: | |
46 | + - ..:/home/pyros_user/app | |
47 | + # tells which port of local machine can communicate with the docker image (host:container), host is your local machine | |
48 | + ports: | |
49 | + - "${PYROS_WEBSITE_PORT:-8000}:${PYROS_WEBSITE_PORT:-8000}" | |
50 | + # starting db service before install service | |
51 | + depends_on: | |
52 | + - db | |
53 | + # create network to allow images to communicate with other images within the same network | |
54 | + networks: | |
55 | + - pyros-network | |
56 | + #ipv4_address: "${IP_PYROS_USER}" | |
57 | + restart: always | |
58 | + | |
59 | + pyros2: | |
60 | + # path to the Dockerfile of this image | |
61 | + build: | |
62 | + context: .. | |
63 | + dockerfile: Dockerfile-django2 | |
64 | + container_name: pyros2 | |
65 | + # tty is the -t option in docker exec | |
66 | + tty: true | |
67 | + # stdin_open is the -i option in docker exec | |
68 | + stdin_open: true | |
69 | + env_file: | |
70 | + - variables.env | |
71 | + environment: | |
72 | + # environment variables only for Docker | |
73 | + - WITH_DOCKER=y | |
74 | + - MYSQL_ROOT_LOGIN=root | |
75 | + - MYSQL_TCP_PORT=3306 | |
76 | + # environment variables available for both Docker usage and non Docker usage | |
77 | + - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}" | |
78 | + - "MYSQL_PYROS_LOGIN=${MYSQL_PYROS_LOGIN:-pyros}" | |
79 | + - "MYSQL_PYROS_PWD=${MYSQL_PYROS_PWD:-DjangoPyros}" | |
80 | + - PYROS_WEBSITE_PORT=8002 | |
81 | + #- "IP_PYROS_USER=${IP_PYROS_USER:-172.28.1.5}" | |
82 | + volumes: | |
83 | + - ..:/home/pyros_user/app | |
84 | + # tells which port of local machine can communicate with the docker image (host:container), host is your local machine | |
85 | + ports: | |
86 | + - 8002:8002 | |
87 | + # starting db service before install service | |
88 | + depends_on: | |
89 | + - db | |
90 | + # create network to allow images to communicate with other images within the same network | |
91 | + networks: | |
92 | + - pyros-network | |
93 | + #ipv4_address: "${IP_PYROS_USER}" | |
94 | + restart: always | |
95 | + | |
96 | +# declaring volumes | |
97 | +volumes: | |
98 | + db: | |
99 | + driver: local | |
100 | +# declaring networks | |
101 | +networks: | |
102 | + pyros-network: | |
103 | + #bridge is the default network driver | |
104 | + driver: bridge | |
0 | 105 | \ No newline at end of file | ... | ... |