Skip to content

Commit

Permalink
Update Dockerfile and add docker-compose.yaml for a production ready …
Browse files Browse the repository at this point in the history
…build
  • Loading branch information
pharr117 committed Oct 11, 2023
1 parent 7c09bc3 commit 4cdd7f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ COPY . /app/

# Expose port 5000 for the Flask app to listen on when running within the container
EXPOSE 5000

# Define the command to start the container. Use gunicorn as the WSGI server to serve the Flask app
# CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
CMD ["python", "app.py"]
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
reader:
build:
context: .
ports:
- "5000:5000"
volumes:
- cache-volume:/var/lib/cache
command: ["gunicorn", "--bind", "0.0.0.0:5000", "-w", "4", "app:get_production_flask_app(\"/var/lib/cache\")"]
writer:
build:
context: .
volumes:
- cache-volume:/var/lib/cache
command: ["python", "app.py", "writer", "--cache-location", "/var/lib/cache"]

volumes:
cache-volume:

0 comments on commit 4cdd7f7

Please sign in to comment.