Compare commits

...

3 Commits

Author SHA1 Message Date
simon 90665f1491
fix plt_fill take lists only 2022-12-26 19:15:22 +07:00
simon 3173cb8359
add restart always key 2022-12-26 18:50:07 +07:00
simon 1c8faf712f
simplify build in docker compose, fix umami link 2022-12-26 18:37:43 +07:00
4 changed files with 16 additions and 14 deletions

View File

@ -16,8 +16,7 @@ function sync_docker {
--exclude static/dyn \
web "$remote_host":docker/
ssh "$remote_host" 'docker build -t bbilly1/lpb-air:latest docker/web'
ssh "$remote_host" 'docker compose -f docker/docker-compose.yml up -d'
ssh "$remote_host" 'docker compose -f docker/docker-compose.yml up -d --build'
}
@ -36,8 +35,7 @@ function sync_test {
--exclude static/dyn \
web "$local_host":docker/
ssh "$local_host" 'docker build -t bbilly1/lpb-air:latest docker/web'
ssh "$local_host" 'docker compose -f docker/docker-compose.yml up -d'
ssh "$local_host" 'docker compose -f docker/docker-compose.yml up -d --build'
}

View File

@ -5,6 +5,7 @@ services:
nginx-proxy:
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
restart: always
ports:
- 80:80
- 443:443
@ -16,6 +17,7 @@ services:
nginx-proxy-acme:
image: nginxproxy/acme-companion
container_name: nginx-proxy-acme
restart: always
volumes:
- ./volume/nginx-proxy/certs:/etc/nginx/certs
- ./volume/nginx-proxy/vhost:/etc/nginx/vhost.d
@ -26,7 +28,7 @@ services:
- NGINX_PROXY_CONTAINER=nginx-proxy
# backend flask
flask:
image: bbilly1/lpb-air
build: ./web
container_name: flask
restart: always
volumes:
@ -62,7 +64,7 @@ services:
- "5432"
# umami stats
umami:
image: ghcr.io/mikecao/umami:postgresql-latest
image: docker.umami.dev/umami-software/umami:postgresql-latest
container_name: umami
expose:
- "3000"

View File

@ -3,7 +3,7 @@ version: "3.2"
services:
# backend flask
flask:
image: bbilly1/lpb-air
build: ./web
container_name: flask
restart: always
volumes:

View File

@ -19,26 +19,28 @@ def get_config():
def plt_fill(plt, x, y):
""" fill colors between break points """
x_list = list(x)
y_list = list(y)
plt.fill_between(
x, y, y2=0, where=(y > 0), color='#85a762', interpolate=True
x_list, y_list, y2=0, where=(y > 0), color='#85a762', interpolate=True
) # good
plt.fill_between(
x, y, y2=50, where=(y > 50), color='#d4b93c', interpolate=True
x_list, y_list, y2=50, where=(y > 50), color='#d4b93c', interpolate=True
) # moderate
plt.fill_between(
x, y, y2=100, where=(y > 100), color='#e96843', interpolate=True
x_list, y_list, y2=100, where=(y > 100), color='#e96843', interpolate=True
) # ufsg
plt.fill_between(
x, y, y2=150, where=(y > 150), color='#d03f3b', interpolate=True
x_list, y_list, y2=150, where=(y > 150), color='#d03f3b', interpolate=True
) # unhealthy
plt.fill_between(
x, y, y2=200, where=(y > 200), color='#be4173', interpolate=True
x_list, y_list, y2=200, where=(y > 200), color='#be4173', interpolate=True
) # vunhealthy
plt.fill_between(
x, y, y2=300, where=(y > 300), color='#714261', interpolate=True
x_list, y_list, y2=300, where=(y > 300), color='#714261', interpolate=True
) # hazardous
plt.fill_between(
x, y, y2=0, where=(y > 0), color='#ffffff', alpha=0.1, interpolate=True
x_list, y_list, y2=0, where=(y > 0), color='#ffffff', alpha=0.1, interpolate=True
) # soft