add osmtile and remove nginx

This commit is contained in:
Daniel afx 2022-02-04 01:27:40 +02:00
parent 24a92139eb
commit 2c26a62844
3 changed files with 49 additions and 45 deletions

View file

@ -1,37 +1,69 @@
version: '3.8'
services:
lb:
image: haproxy:latest
ports:
- "80:80"
- "443:443"
volumes:
- "./data/certificates:/certificates"
- "./config/lb:/usr/local/etc/haproxy"
depends_on:
- "certbot"
restart: always
networks:
- internal
labels:
- meta.role=lb
certbot:
image: "certbot/certbot"
hostname: certbot
volumes:
- "./data/certificates:/certificates"
- "./data/certbot/etc:/etc/letsencrypt"
- "./data/certbot/var:/var/lib/letsencrypt"
- "./logs/certbot:/var/log/letsencrypt"
restart: on-failure
networks:
- internal
labels:
- meta.role=certbot
#entrypoint: sh -c 'while true; do sleep 1; done'
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 15d & wait $${!}; done;'"
flask:
build:
context: ./flask
dockerfile: Dockerfile.prod
command: gunicorn --bind 0.0.0.0:5000 manage:app
volumes:
- static_volume:/home/app/web/forest/static
- media_volume:/home/app/web/forest/media
expose:
- 5000
env_file:
- ./.env.prod
networks:
- internal
depends_on:
- db
db:
image: postgres:13-alpine
volumes:
- postgres_data_prod:/var/lib/postgresql/data/
- "./data/db/pgdata:/var/lib/postgresql/data/"
env_file:
- ./.env.prod
nginx:
build: ./nginx
networks:
- internal
osmtile:
image: "overv/openstreetmap-tile-server:latest"
hostname: osmtile
environment:
- "DOWNLOAD_PBF=https://download.geofabrik.de/europe/bulgaria-latest.osm.pbf"
- "DOWNLOAD_POLY=https://download.geofabrik.de/europe/bulgaria.poly"
volumes:
- static_volume:/home/app/web/forest/static
- media_volume:/home/app/web/forest/media
ports:
- 1337:80
depends_on:
- web
volumes:
postgres_data_prod:
static_volume:
media_volume:
- "./data/osmtile/pgdata:/var/lib/postgresql/12/main"
networks:
- internal
#entrypoint: "/run.sh import"
entrypoint: "/run.sh run"
restart: always
networks:
internal: {}

View file

@ -1,4 +0,0 @@
FROM nginx:1.19-alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d

View file

@ -1,24 +0,0 @@
upstream forest {
server flask:5000;
}
server {
listen 80;
location / {
proxy_pass http://forest;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /static/ {
alias /home/app/web/project/static/;
}
location /media/ {
alias /home/app/web/project/media/;
}
}