-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocker-compose.yml
94 lines (90 loc) · 3.26 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
# /**
# *******************************************************************************
# ** Created by Tinz Twins
# **
# ** Copyright © 2022 tinztwins.de. All rights reserved.
# **
# ** Redistributions of source code must retain the above copyright notice,
# ** this condition and the following disclaimer.
# **
# ** This software is provided by the copyright holder and contributors
# ** and any warranties related to this software are DISCLAIMED.
# ** The copyright owner or contributors be NOT LIABLE for any damages caused
# ** by use of this software.
# *******************************************************************************
# */
services:
sftp:
image: ${SFTP_IMAGE}
container_name: sftp
restart: always
ports:
- "${SFTP_PORT}:22"
command:
- ${SFTP_USERNAME}:${SFTP_PASSWORD}:1001::${MLFLOW_ARTIFACT_STORE} # syntax: user:password[:e][:uid[:gid[:dir1[,dir2]...]]]
volumes:
- ./${MLFLOW_ARTIFACT_STORE}:/home/${SFTP_USERNAME}/${MLFLOW_ARTIFACT_STORE}
- ./keys/ssh_host_rsa_key.pub:/home/${SFTP_USERNAME}/.ssh/ssh_host_rsa_key.pub:ro
- ./keys/ssh_host_ed25519_key.pub:/home/${SFTP_USERNAME}/.ssh/ssh_host_ed25519_key.pub:ro
mlflow:
build:
context: ./docker/mlflow
image: workspace/mlflow
container_name: mlflow
restart: on-failure
ports:
- "${MLFLOW_TRACKING_SERVER_PORT}:5000"
depends_on:
- postgres
- sftp
volumes:
- ./${MLFLOW_ARTIFACT_STORE}:/${MLFLOW_ARTIFACT_STORE}
- ./keys/ssh_host_rsa_key:/root/.ssh/ssh_host_rsa_key:ro
- ./keys/ssh_host_ed25519_key:/root/.ssh/ssh_host_ed25519_key:ro
- ./keys/config:/root/.ssh/config:ro
command: >
/bin/bash -c "sleep 3
&& cd /root/.ssh
&& ssh-keyscan ${SFTP_HOST} >> known_hosts
&& cd /server
&& ./wait-for-it.sh ${MLFLOW_BACKEND_STORE}:5432 -t ${WAIT_FOR_IT_TIMEOUT} -- mlflow server
--backend-store-uri postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${MLFLOW_BACKEND_STORE}:5432/${POSTGRES_DATABASE}
--default-artifact-root sftp://${SFTP_USERNAME}:${SFTP_PASSWORD}@${SFTP_HOST}/${MLFLOW_ARTIFACT_STORE}
--host ${MLFLOW_TRACKING_SERVER_HOST}
--port 5000"
postgres:
build: ./docker/postgres
image: workspace/postgres
container_name: postgres
restart: always
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- ./${POSTGRES_STORE}:/var/lib/postgresql/data
jupyter:
user: root
build:
context: ./docker/jupyter
image: workspace/jupyter
container_name: jupyter
restart: on-failure
ports:
- "${JUPYTER_PORT}:8888"
depends_on:
- postgres
- mlflow
- sftp
environment:
MLFLOW_TRACKING_URI: "http://mlflow:5000"
JUPYTER_ENABLE_LAB: ${JUPYTER_ENABLE_LAB}
SFTP_HOST: ${SFTP_HOST}
JUPYTER_USERNAME: ${JUPYTER_USERNAME}
JUPYTER_TOKEN: ${JUPYTER_TOKEN}
volumes:
- ./notebooks/:/home/${JUPYTER_USERNAME}/work
- ./keys/ssh_host_rsa_key:/home/${JUPYTER_USERNAME}/.ssh/ssh_host_rsa_key:ro
- ./keys/ssh_host_ed25519_key:/home/${JUPYTER_USERNAME}/.ssh/ssh_host_ed25519_key:ro
- ./keys/config:/home/${JUPYTER_USERNAME}/.ssh/config:ro