Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
107 lines (100 loc) · 2.4 KB
/
Copy pathdocker-compose.yml
File metadata and controls
107 lines (100 loc) · 2.4 KB
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
services:
simulator:
build:
context: .
dockerfile: Dockerfile
target: data-quality-simulator
image: data-quality-simulator
environment:
LOGGER_LEVEL: ${SIMULATOR_LOGGER_LEVEL:-info}
depends_on:
db:
condition: service_completed_successfully
command:
[
"--config-file-path=${SIMULATOR_CONFIG_FILE_PATH:-config-files/base_config.json}"
]
volumes:
- ./config-files:/app/config-files
- ./datasets:/app/datasets
- ./db/data:/app/db
db:
image: keinos/sqlite3:3.46.0
working_dir: /db
user: "${uid:-1000}:${gid:-1000}"
group_add:
- sqlite
volumes:
- ./db/init/seed.sql:/initdb.d/seed.sql
- ./db/data:/db
command:
[
"sh",
"-c",
"cat /initdb.d/seed.sql | sqlite3 simulations.db && chmod 666 simulations.db"
]
# https://stackoverflow.com/q/51120204/5587393
notebook:
build:
dockerfile_inline: |
FROM quay.io/jupyter/base-notebook:latest
RUN pip install pandas==2.2.2 matplotlib==3.9.0
image: notebook
container_name: jupyter-notebook
user: "${uid:-1000}:${gid:-1000}"
group_add:
- users
ports:
- 8889:8888
volumes:
- ./notebooks:/home/jovyan/code
- ./db/data:/home/jovyan/db:ro
- ./results:/home/jovyan/results:ro
command: start-notebook.py --NotebookApp.token='my-token'
get-results:
image: keinos/sqlite3:3.46.0
working_dir: /db
volumes:
- ./db/data:/db:ro
command:
[
"sh",
"-c",
"printf \".mode markdown
select * from results;\" | sqlite3 simulations.db"
]
count-results:
image: keinos/sqlite3:3.46.0
working_dir: /db
volumes:
- ./db/data:/db:ro
command:
[
"sh",
"-c",
"echo \"select count(*) from results;\" | sqlite3 simulations.db"
]
delete-all:
image: keinos/sqlite3:3.46.0
working_dir: /db
user: "${uid:-1000}:${gid:-1000}"
volumes:
- ./db/data:/db
command:
[
"sh",
"-c",
"echo \"delete from results;\" | sqlite3 simulations.db"
]
run-query:
image: keinos/sqlite3:3.46.0
working_dir: /db
user: "${uid:-1000}:${gid:-1000}"
volumes:
- ./db/data:/db
command:
[
"sh",
"-c",
"echo \"${SQL_CODE}\" | sqlite3 remote-simulations.db"
]