feat: add Docker support with Coolify deployment instructions
This commit is contained in:
parent
e35c270f02
commit
e0c1bbe3a2
10
.dockerignore
Normal file
10
.dockerignore
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.pyd
|
||||||
|
.env
|
||||||
|
node_modules/
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
windsurfrules
|
||||||
|
Input/
|
||||||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Use official Python image
|
||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY requirements.txt ./
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
EXPOSE 5000
|
||||||
|
CMD ["python", "app.py"]
|
||||||
19
README.md
19
README.md
@ -1 +1,20 @@
|
|||||||
|
## Sport Attendance Sheet
|
||||||
|
|
||||||
A simple, editable attendance table with dates as rows and player names (plus guest) as columns. Users can mark their attendance with a click. No login, no user management, just a fast and easy attendance tracker.
|
A simple, editable attendance table with dates as rows and player names (plus guest) as columns. Users can mark their attendance with a click. No login, no user management, just a fast and easy attendance tracker.
|
||||||
|
|
||||||
|
### Deploying to Coolify (Docker)
|
||||||
|
|
||||||
|
1. **Build and push the Docker image** (or connect your repo to Coolify):
|
||||||
|
- If using Git: Push this repo to your Git provider and connect it in Coolify.
|
||||||
|
- If building locally:
|
||||||
|
```sh
|
||||||
|
docker build -t yourusername/sport-attendance-sheet .
|
||||||
|
docker run -p 5000:5000 yourusername/sport-attendance-sheet
|
||||||
|
```
|
||||||
|
2. **Create a new Docker app in Coolify**
|
||||||
|
- Set the port to `5000`.
|
||||||
|
- Ensure persistent storage for `attendance_data.json` if you want data to survive redeploys.
|
||||||
|
- Set environment variable `PORT=5000` if needed.
|
||||||
|
|
||||||
|
3. **Access your app**
|
||||||
|
- Once deployed, your app will be available at the URL Coolify provides.
|
||||||
4
app.py
4
app.py
@ -43,4 +43,6 @@ def update_data():
|
|||||||
return jsonify({"status": "success"})
|
return jsonify({"status": "success"})
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True)
|
import os
|
||||||
|
port = int(os.environ.get('PORT', 5000))
|
||||||
|
app.run(host='0.0.0.0', port=port, debug=False)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user