added postgres to docker for later integration

This commit is contained in:
simon 2021-02-16 17:57:25 +07:00
parent 58406828ee
commit 9b3c0b06c5
4 changed files with 25 additions and 1 deletions

8
.gitignore vendored
View File

@ -5,5 +5,11 @@ __pycache__
config
config.h
# env files
postgres.env
# frontend font files
*.ttf
*.ttf
# dynamic files
**/dyn/*.json

View File

@ -1,7 +1,11 @@
#!/bin/bash
# upload project to vps2
# get last dyn
wget data.lpb-air.com --output-document=backend/flask/dyn/air.json
rsync --progress -a docker-compose.yml vps2:docker/
rsync --progress -a env vps2:docker/
rsync --progress -a --delete-after \
--exclude dyn --exclude config.sample --exclude __pychache__ \
backend vps2:docker/

View File

@ -51,6 +51,17 @@ services:
- LETSENCRYPT_HOST=data.lpb-air.com
expose:
- "80"
# backend postgres
postgres:
image: postgres
container_name: postgres
restart: always
volumes:
- ./volume/postgres:/var/lib/postgresql/data/
env_file:
- ./env/postgres.env
expose:
- "5432"
# php fast-cgi
php:
image: php:7-fpm

3
env/postgres.sample.env vendored Normal file
View File

@ -0,0 +1,3 @@
POSTGRES_USER=aqi
POSTGRES_PASSWORD=aaaaaaaaaaaaaaaaa
POSTGRES_DB=aqi