-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
65 lines (60 loc) · 2.25 KB
/
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
# List of Services
services:
spring:
build: ./spring # Look for Dockerfile in this path
ports:
- "8080:8080" # Expose port 8080
environment:
# These are used in apllication.property to setup DB connection
- DB_ADDRESS=jdbc:mysql://mysql:3306
- DB_DATABASE=geojobsearch
- DB_USER=root
- DB_PASSWORD=pwd
# volumes:
# - ./spring:src
networks:
- spring-mysql # Allow the spring app to discover the mysql app
- spring-react # Allow the spring app to talk to the react app
mysql:
build: ./mysql # Look for Dockerfile in this path
environment:
# Mysql docker image env vars
- MYSQL_ROOT_PASSWORD=pwd
- MYSQL_DATABASE=geojobsearch
volumes:
- mariadb_data:/var/lib/mysql
networks:
- spring-mysql # Allow the mysql app to talk to the spring app
ports:
- "3306:3306" # Exposes port 3306 on the host and maps it to port 3306 in the container
react:
build: ./react # Look for Dockerfile in this path
ports:
- "3000:3000" # Expose port 3000
environment:
# Tell the react app that our spring server is running here
- BACKEND_PROXY=http://spring:8080
volumes:
- ./react/src:/src
networks:
- spring-react # Allow the react app to discover the spring app
python: # The Python application service
build: ./web-scraper # Builds the Docker image from the Dockerfile in the './python' directory
environment: # Environment variables for the Python service
- SELENIUM_MANAGER_OFFLINE=true
- DB_HOST=mysql # Hostname for the MySQL database, 'mysql' is the service name in docker-compose
- DB_DATABASE=geojobsearch # The name of the database to use
- DB_USER=root # The username for the database
- DB_PASSWORD=pwd # The password for the database
depends_on:
- mysql # Ensures MySQL service is started before the Python service
networks:
- spring-mysql # Connects to the same network as MySQL for communication
volumes: # Maps a directory from the host to a directory in the container
- /tmp/imports:/usr/app/import # Maps '/tmp/imports' on the host to '/usr/app/import' in the container
volumes:
mariadb_data:
# List of Networks
networks:
spring-mysql:
spring-react: