Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 39 additions & 4 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,23 @@ services:
- jupyter
- api
- minio
- streamlit-ca
- streamlit-sysdyn
networks:
- dissmodel-net

#sudo chmod -R 775 ./workspace
jupyter:
build:
context: ./services/frontend
dockerfile: Dockerfile
container_name: dissmodel-jupyter
restart: unless-stopped
command: ["start-notebook.sh", "--NotebookApp.token=''", "--ServerApp.base_url=/dissmodel/jupyter/"]
command:
- start-notebook.sh
- --ServerApp.base_url=/dissmodel/jupyter/
- --ServerApp.token=
- --ServerApp.trust_xheaders=True
volumes:
- ./workspace:/home/jovyan/work
- ./data/inputs:/data/inputs:ro
Expand All @@ -42,7 +49,6 @@ services:
- configs-sync
networks:
- dissmodel-net
# Sobrescreve o healthcheck do Dockerfile para usar a nova base_url
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8888/dissmodel/jupyter/api"]
interval: 30s
Expand Down Expand Up @@ -117,6 +123,36 @@ services:
- minio
- configs-sync

# ── Streamlit CA Explorer ─────────────────────────────────────────────────
streamlit-ca:
build:
context: ./services/streamlit-ca
dockerfile: Dockerfile
container_name: dissmodel-streamlit-ca
restart: unless-stopped
networks:
- dissmodel-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/dissmodel/ca/healthz"]
interval: 30s
timeout: 10s
retries: 3

# ── Streamlit SysDyn Explorer ─────────────────────────────────────────────
streamlit-sysdyn:
build:
context: ./services/streamlit-sysdyn
dockerfile: Dockerfile
container_name: dissmodel-streamlit-sysdyn
restart: unless-stopped
networks:
- dissmodel-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/dissmodel/sysdyn/healthz"]
interval: 30s
timeout: 10s
retries: 3

minio:
image: minio/minio:RELEASE.2024-01-01T16-36-33Z
container_name: dissmodel-minio
Expand All @@ -127,7 +163,6 @@ services:
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-inpe_admin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-inpe_secret_2024}
# URL pública do Console do MinIO (suporta subcaminhos)
- MINIO_BROWSER_REDIRECT_URL=${MINIO_BROWSER_REDIRECT_URL:-http://localhost/dissmodel/minio/ui}
env_file:
- .env
Expand Down Expand Up @@ -186,4 +221,4 @@ volumes:
redis-data:
name: dissmodel-prod-redis-data
configs-data:
name: dissmodel-prod-configs-data
name: dissmodel-prod-configs-data
28 changes: 27 additions & 1 deletion services/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ http {

# Jupyter
location /dissmodel/jupyter/ {
proxy_pass http://jupyter:8888;
proxy_pass http://jupyter:8888/dissmodel/jupyter/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -47,6 +47,32 @@ http {
proxy_read_timeout 86400;
}

# Streamlit CA Explorer
location /dissmodel/ca/ {
proxy_pass http://streamlit-ca:8501/dissmodel/ca/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
}

# Streamlit SysDyn Explorer
location /dissmodel/sysdyn/ {
proxy_pass http://streamlit-sysdyn:8501/dissmodel/sysdyn/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
}

# MinIO API
location /dissmodel/minio/ {
# Importante: O trailing slash no proxy_pass remove o prefixo /dissmodel/minio/
Expand Down
21 changes: 21 additions & 0 deletions services/streamlit-ca/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.11-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
libgdal-dev gcc git \
&& rm -rf /var/lib/apt/lists/*

RUN git clone --depth 1 https://github.com/DisSModel/dissmodel-ca.git /tmp/repo \
&& pip install --no-cache-dir dissmodel /tmp/repo streamlit matplotlib \
&& cp /tmp/repo/src/dissmodel_ca/streamlit/ca_all.py /app/app.py \
&& rm -rf /tmp/repo

EXPOSE 8501

CMD ["streamlit", "run", "app.py", \
"--server.address", "0.0.0.0", \
"--server.port", "8501", \
"--server.headless", "true", \
"--server.baseUrlPath", "/dissmodel/ca", \
"--browser.gatherUsageStats", "false"]
21 changes: 21 additions & 0 deletions services/streamlit-sysdyn/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.11-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
libgdal-dev gcc git \
&& rm -rf /var/lib/apt/lists/*

RUN git clone --depth 1 https://github.com/DisSModel/dissmodel-sysdyn.git /tmp/repo \
&& pip install --no-cache-dir dissmodel /tmp/repo streamlit matplotlib \
&& cp /tmp/repo/src/dissmodel_sysdyn/streamlit/sysdyn_all.py /app/app.py \
&& rm -rf /tmp/repo

EXPOSE 8501

CMD ["streamlit", "run", "app.py", \
"--server.address", "0.0.0.0", \
"--server.port", "8501", \
"--server.headless", "true", \
"--server.baseUrlPath", "/dissmodel/sysdyn", \
"--browser.gatherUsageStats", "false"]
Loading
Loading