generated from swiss-ai-center/create-a-new-service-generic-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
32 lines (32 loc) · 946 Bytes
/
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
services:
service:
build:
context: .
dockerfile: development.Dockerfile
command: |
bash -c "
if [ -d .venv ];
then
echo '.venv exists and is not empty';
else
echo '.venv does not exist or is empty';
python3.11 -m venv .venv;
fi &&
# Activate the virtual environment
source .venv/bin/activate &&
# Install the dependencies
pip install -r requirements.txt -r requirements-all.txt &&
# Run the service
cd src &&
exec uvicorn --reload --host 0.0.0.0 --port 7575 main:app
"
environment:
- ENGINE_URLS=["http://host.docker.internal:8080"]
- SERVICE_URL=http://host.docker.internal:${SERVICE_PORT}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- ${SERVICE_PORT}:7575
working_dir: /workspaces/service
volumes:
- .:/workspaces/service