diff --git a/Dockerfile b/Dockerfile index 61c7427..1ba668e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..9f89bbf --- /dev/null +++ b/docker-compose.yaml @@ -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: \ No newline at end of file