docker
This commit is contained in:
parent
630410797b
commit
16a2d8a53d
@ -8,12 +8,16 @@ COPY requirements.txt .
|
||||
|
||||
# Install the required packages
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip install gunicorn
|
||||
|
||||
# Copy the rest of the application code into the container
|
||||
COPY src src
|
||||
COPY src .
|
||||
|
||||
# Expose the port the app runs on
|
||||
EXPOSE 5000
|
||||
|
||||
# Set environment variables
|
||||
ENV FLASK_APP=main.py
|
||||
|
||||
# run the application
|
||||
CMD ["python", "src/main.py"]
|
||||
ENTRYPOINT [ "gunicorn", "-b", ":5000", "--access-logfile", "-", "--error-logfile", "-", "main:app" ]
|
@ -63,6 +63,8 @@ except:
|
||||
# Configure utils
|
||||
log.info("Configuring utils")
|
||||
conv = utils.data_converter(db)
|
||||
log.info("Configuration complete")
|
||||
|
||||
|
||||
|
||||
# Define routes
|
||||
@ -718,4 +720,9 @@ def error(error_message):
|
||||
|
||||
# Run the app
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
log.info("Starting development server")
|
||||
app.run(
|
||||
host=env('HOST', default='0.0.0.0'),
|
||||
port=env('PORT', default=5000),
|
||||
debug=env('DEBUG', default=True)
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user