feat: set up waitress as production server

This commit is contained in:
Julian Lobbes 2022-12-01 02:28:44 +01:00
parent 5d936900be
commit 3ef08de465
4 changed files with 7 additions and 30 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
*/__pycache__

View File

@ -8,4 +8,8 @@ FROM python:3
# Install dependencies # Install dependencies
WORKDIR /app WORKDIR /app
COPY requirements.txt /app/ COPY requirements.txt /app/
COPY lumi2 /app/lumi2/
COPY tests /app/tests/
COPY pytest.ini /app/
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
ENTRYPOINT ["waitress-serve", "--listen=0.0.0.0:80", "--no-ipv6", "--call", "lumi2:create_app"]

View File

@ -6,25 +6,8 @@ services:
lumi2: lumi2:
build: . build: .
container_name: lumi2 container_name: lumi2
command: flask --app /app/lumi2 --debug run --host 0.0.0.0 --port 80
volumes: volumes:
- ./config.py/:/app/config.py:ro - ./config.py/:/app/config.py:ro
- ./lumi2/__init__.py:/app/lumi2/__init__.py:ro
- ./lumi2/auth.py:/app/lumi2/auth.py:ro
- ./lumi2/default_configuration.py:/app/lumi2/default_configuration.py:ro
- ./lumi2/exceptions.py:/app/lumi2/exceptions.py:ro
- ./lumi2/ldap.py:/app/lumi2/ldap.py:ro
- ./lumi2/logging.py:/app/lumi2/logging.py:ro
- ./lumi2/static/css:/app/lumi2/static/css:ro
- ./lumi2/static/fonts:/app/lumi2/static/fonts:ro
- ./lumi2/static/images/base:/app/lumi2/static/images/base:ro
- ./lumi2/static/images/default:/app/lumi2/static/images/default:ro
- ./lumi2/static/js:/app/lumi2/static/js:ro
- ./lumi2/templates/:/app/lumi2/templates/:ro
- ./lumi2/usermanager.py:/app/lumi2/usermanager.py:ro
- ./lumi2/usermodel.py:/app/lumi2/usermodel.py:ro
- ./lumi2/webapi.py:/app/lumi2/webapi.py:ro
- ./tests/fakedata.py/:/app/tests/fakedata.py:ro
environment: environment:
- LUMI_CONFIG=/app/config.py - LUMI_CONFIG=/app/config.py
ports: ports:
@ -46,18 +29,6 @@ services:
LDAP_DOMAIN: "example.com" LDAP_DOMAIN: "example.com"
LDAP_ADMIN_PASSWORD: "admin" LDAP_ADMIN_PASSWORD: "admin"
LDAP_CONFIG_PASSWORD: "admin" LDAP_CONFIG_PASSWORD: "admin"
LDAP_TLS_VERIFY_CLIENT: "allow" LDAP_TLS_VERIFY_CLIENT: "never"
lumi2-phpldapadmin:
container_name: lumi2-phpldapadmin
image: osixia/phpldapadmin
restart: unless-stopped
depends_on:
- lumi2-openldap
ports:
- "8001:80"
environment:
PHPLDAPADMIN_LDAP_HOSTS: "openldap"
PHPLDAPADMIN_HTTPS: "false"
PHPLDAPADMIN_SERVER_ADMIN: "admin"
... ...

View File

@ -9,3 +9,4 @@ Flask-WTF==1.0.1
Flask-RESTful==0.3.9 Flask-RESTful==0.3.9
Faker==15.3.3 Faker==15.3.3
requests==2.28.1 requests==2.28.1
waitress==2.1.2