Skip to content

Commit

Permalink
switched to using umami cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaH84 committed Nov 13, 2024
1 parent e1929c6 commit 019d627
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 46 deletions.
60 changes: 30 additions & 30 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- /etc/letsencrypt:/etc/letsencrypt
- /usr/share/nginx/html/.well-known:/usr/share/nginx/html/.well-known
entrypoint: /bin/sh -c "trap exit TERM; while :; do certbot renew --webroot -w /usr/share/nginx/html --quiet; sleep 12h; done"

gui:
image: ghcr.io/battmoteam/battmoapp_gui:latest
build: ./gui
Expand All @@ -53,38 +53,38 @@ services:
- app-network
command: streamlit run app.py --global.disableWidgetStateDuplicationWarning true --server.port=8501

umami:
image: docker.umami.is/umami-software/umami:postgresql-latest
container_name: umami
restart: always
environment:
BASE_URL: https://app.batterymodel.com/umami
DATABASE_URL: postgres://umami:password@umami-db/umami
DATABASE_TYPE: postgres
HASH_SALT: ${HASH_SALT}
ports:
- "3000:3000"
networks:
- app-network
depends_on:
- umami-db
# umami:
# image: docker.umami.is/umami-software/umami:postgresql-latest
# container_name: umami
# restart: always
# environment:
# BASE_URL: https://app.batterymodel.com/umami
# DATABASE_URL: postgres://umami:password@umami-db/umami
# DATABASE_TYPE: postgres
# HASH_SALT: ${HASH_SALT}
# ports:
# - "3000:3000"
# networks:
# - app-network
# depends_on:
# - umami-db

umami-db:
image: postgres:13
container_name: umami-db
restart: always
environment:
POSTGRES_USER: umami
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: umami
networks:
- app-network
volumes:
- umami_db_data:/var/lib/postgresql/data
# umami-db:
# image: postgres:13
# container_name: umami-db
# restart: always
# environment:
# POSTGRES_USER: umami
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# POSTGRES_DB: umami
# networks:
# - app-network
# volumes:
# - umami_db_data:/var/lib/postgresql/data

# Define volumes at the root level, outside of services
volumes:
umami_db_data:
# volumes:
# umami_db_data:

networks:
app-network:
Expand Down
8 changes: 5 additions & 3 deletions gui/app_pages/Home.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
)
from app_scripts import app_view

# components.html(
# '<script defer src="https://app.batterymodel.com/umami/script.js" data-website-id="213d7c39-2f27-43d9-822e-7e0e855273db"></script>'
# )

components.html(
'<script defer src="https://app.batterymodel.com/umami/script.js" data-website-id="213d7c39-2f27-43d9-822e-7e0e855273db"></script>'
'<script defer src="https://cloud.umami.is/script.js" data-website-id="adcac53d-bc65-4ca3-9f98-be5c7c4ee75d"></script>'
)


# ##############################
# # Remember user changed values
for k, v in st.session_state.items():
Expand Down
28 changes: 15 additions & 13 deletions nginx/project.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ server {
}

# Umami analytics application proxy
location /umami/ {
proxy_pass http://umami:3000/;
proxy_http_version 1.1;
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;
# rewrite /umami/(.*) /$1 break;
}

location /umami/static/ {
alias /path/to/umami/static/; # Make sure static assets are served correctly
}
# location /umami/ {
# proxy_pass http://umami:3000/;
# proxy_http_version 1.1;
# 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_redirect off;
# # rewrite /umami/(.*) /$1 break;
# }

# Serve static assets (JS, CSS, images)
# location /umami/static/ {
# alias /path/to/umami/static/; # Make sure static assets are served correctly
# }

# SSL configuration
ssl_protocols TLSv1.2 TLSv1.3;
Expand Down

0 comments on commit 019d627

Please sign in to comment.