Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions DOCKER_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# How to use Docker for this

You will need the following structure:

```bash
root/
├─ evora-server/
├─ evora-client/
├─ docker-compose.yml
```

The `docker-compose.yml` is a new file that is attached below:

```yaml
version: '3.8'

services:
evora-server:
build:
context: ./evora-server
ports:
- "3000:3000"
volumes:
- ./evora-server:/usr/src/app
command: python app.py # Start the Flask app
environment:
- FLASK_RUN_HOST=0.0.0.0 # Bind to all interfaces for external access
- FLASK_ENV=development # Optional: Enables Flask debug mode for development

evora-client:
build:
context: ./evora-client
ports:
- "3001:3001"
volumes:
- ./evora-client:/usr/src/app
- /usr/src/app/node_modules # Add this to map node_modules correctly

command: npm start # Start the React app
environment:
- PORT=3001 # Set the port for the React app
depends_on:
- evora-server
```

When you have this structure, go to the root directory and use the following command in the console (install Docker first):
`docker compose up --build`
which will build the container and run it. Then you can access the web app at

`http://127.0.0.1:3001`.

Note: When you React or Flask files, you do NOT need to rebuild the container. It will be automatically updated without you having to restart anything.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use the official Python image
FROM python:3.10-slim

# Set working directory
WORKDIR /usr/src/app

# Copy and install dependencies
COPY . .
RUN pip install .

# Set environment variables if needed
# ENV FLASK_ENV=development

# Expose the port Flask runs on
EXPOSE 3000

# Start the Flask app
CMD ["python", "app.py"]
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,4 @@ def OnExitApp():
# app.run(host='127.0.0.1', port=8000, debug=False, threaded=True, processes=1)

# FOR DEBUGGING, USE:
app.run(host='127.0.0.1', port=3000, debug=True, processes=1, threaded=True)
app.run(host='0.0.0.0', port=3000, debug=True, processes=1, threaded=True)
2 changes: 1 addition & 1 deletion evora/debug.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEBUGGING = False
DEBUGGING = True