This repository has been archived by the owner on Sep 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcompose.yaml
98 lines (95 loc) · 2.58 KB
/
compose.yaml
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
services:
database:
image: mariadb
environment:
MARIADB_ROOT_PASSWORD_FILE: /run/secrets/db_password
MARIADB_DATABASE: helios
secrets:
- db_password
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect"]
interval: 5s
timeout: 10s
retries: 3
start_period: 5s
volumes:
- database-storage:/var/lib/mysql
api:
depends_on:
database:
condition: service_healthy
ports:
- 5000:80
environment:
CONFIG_FILE_PATH: /run/secrets/config_file
secrets:
- config_file
volumes:
- pfss-data:/var/lib/pfss
build:
context: .
dockerfile_inline: |
FROM python:3.11
RUN pip install --no-cache-dir gunicorn pymysql
WORKDIR /app
COPY server /app
COPY compose_config/api/gunicorn_conf.py /app
RUN pip install --no-cache-dir -r requirements.txt
CMD ["gunicorn", "--conf", "gunicorn_conf.py", "--bind", "0.0.0.0:80", "main:app"]
web:
depends_on:
- api
ports:
- 8080:80
build:
context: .
dockerfile_inline: |
FROM httpd:2.4
COPY dist/ /usr/local/apache2/htdocs
# This service downloads pfss files from the server that makes them
# into a shared folder that the api service can access.
pfss_manager:
depends_on:
database:
condition: service_healthy
build:
context: .
dockerfile_inline: |
FROM alpine
RUN apk add --no-cache python3 py3-pip rsync bash openssh
RUN python -m pip install --no-cache-dir sqlalchemy pymysql
WORKDIR /app
COPY server /app
COPY compose_config/pfss_manager/sync_pfss.sh /app
COPY compose_config/pfss_manager/ssh_config /root/.ssh/config
COPY compose_config/pfss_manager/crontab /app
RUN crontab /app/crontab
CMD ["/usr/sbin/crond", "-f", "-d", "0"]
environment:
CONFIG_FILE_PATH: /run/secrets/config_file
PFSS_SSH_KEY: /run/secrets/pfss_key.pem
secrets:
- config_file
- pfss_key.pem
- pfss_host
volumes:
- pfss-data:/var/lib/pfss
# debugger:
# build:
# context: .
# dockerfile_inline: |
# FROM alpine
# RUN apk add --no-cache mariadb
# CMD ["tail", "-F", "/dev/null"]
secrets:
db_password:
file: ./compose_config/database/db_password
config_file:
file: ./compose_config/api/config.ini
pfss_host:
file: ./compose_config/pfss_manager/pfss_host
pfss_key.pem:
file: ./compose_config/pfss_manager/pfss_key.pem
volumes:
pfss-data:
database-storage: