Commit 9838e46b authored by David Mendez's avatar David Mendez
Browse files

Dockerfile: use config.yml file in project root

parent 0698ebfb
......@@ -127,10 +127,11 @@ dmypy.json
# Pycharm project files
.idea/**
# Current config file
/config.yml
# Jobs run dir and output
jobs_run/**
jobs_output/**
app/static/
\ No newline at end of file
app/static/
# Configuration
.env
/config.yml
\ No newline at end of file
......@@ -15,13 +15,10 @@ USER glados
ENV PATH="/home/glados/.local/bin:${PATH}"
RUN pip install --user -r requirements.txt
EXPOSE 5000
COPY . .
FROM base AS development
COPY configurations/minimal_dev_config.yml .
CMD CONFIG_FILE_PATH='/app/minimal_dev_config.yml' FLASK_APP=app flask run
CMD CONFIG_FILE_PATH='/app/config.yml' FLASK_APP=app flask run --host=0.0.0.0
FROM base AS production
COPY configurations/minimal_dev_config.yml .
CMD CONFIG_FILE_PATH='/app/minimal_dev_config.yml' gunicorn wsgi:FLASK_APP -b 0.0.0.0:8080
\ No newline at end of file
CMD CONFIG_FILE_PATH='/app/config.yml' gunicorn wsgi:FLASK_APP -b 0.0.0.0:8080
\ No newline at end of file
......@@ -39,7 +39,8 @@ popd
# Docker
This app can be run completely using Docker and docker-compose.
This app can be run completely using Docker and docker-compose. First, you need to create a file called
'config.yml' with the app configuration. See the configurations folder for examples.
To run the development version of the app:
```bash
......
......@@ -26,6 +26,7 @@ def create_app():
"""
flask_app = Flask(__name__)
# flask_app.config['APPLICATION_ROOT'] = '/abc/123'
flask_app.config['SQLALCHEMY_DATABASE_URI'] = RUN_CONFIG.get('sql_alchemy').get('database_uri')
flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = RUN_CONFIG.get('sql_alchemy').get('track_modifications')
flask_app.config['SECRET_KEY'] = RUN_CONFIG.get('server_secret_key')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment