Add Python Flask Compose files

This commit is contained in:
cytopia 2020-03-24 09:24:42 +01:00
parent 78244371ca
commit c73d5a711f
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 61 additions and 0 deletions

View File

@ -208,6 +208,34 @@ services:
depends_on:
- elastic
# -----------------------------------------------------------------------------------------------
# Python Flask
# -----------------------------------------------------------------------------------------------
# You can add more than one service here if you have multiple flask projects.
# Just duplicate the block and adjust service name, hostname and ip address.
flask1:
image: devilbox/python-flask:${PYTHON_VERSION:-3.8}-dev
hostname: flask1
ports:
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_FLASK:-3000}:${FLASK_PORT:-3000}"
networks:
app_net:
ipv4_address: 172.16.238.250
volumes:
# Mount custom mass virtual hosting
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
environment:
- FLASK_PROJECT=${FLASK_PROJECT}
- FLASK_PORT=${FLASK_PORT:-3000}
- FLASK_APP_DIR=${FLASK_APP_DIR:-htdocs}
- FLASK_APP_FILE=${FLASK_APP_FILE:-main.py}
- NEW_UID
- NEW_GID
depends_on:
- bind
- httpd
###
### Volumes

View File

@ -0,0 +1,33 @@
# vim: set ft=yaml:
---
version: '2.3'
services:
# -----------------------------------------------------------------------------------------------
# Python Flask
# -----------------------------------------------------------------------------------------------
# You can add more than one service here if you have multiple flask projects.
# Just duplicate the block and adjust service name, hostname and ip address.
flask1:
image: devilbox/python-flask:${PYTHON_VERSION:-3.8}-dev
hostname: flask1
ports:
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_FLASK:-3000}:${FLASK_PORT:-3000}"
networks:
app_net:
ipv4_address: 172.16.238.250
volumes:
# Mount custom mass virtual hosting
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
environment:
- FLASK_PROJECT=${FLASK_PROJECT}
- FLASK_PORT=${FLASK_PORT:-3000}
- FLASK_APP_DIR=${FLASK_APP_DIR:-htdocs}
- FLASK_APP_FILE=${FLASK_APP_FILE:-main.py}
- NEW_UID
- NEW_GID
depends_on:
- bind
- httpd