Docker: add .env.example, .dockerignore; polish README Docker section
- Add .env.example (referenced by README Quick Start; populates SECRET_KEY/POSTGRES_*/AUTH0_* used by docker-compose). - Add .dockerignore so `COPY . .` no longer bakes .git, __pycache__, venv, local data, and secrets into the image. - Rewrite README Docker Deployment into a single `docker compose up -d --build` flow on port 5021; fix local-dev access port 5000->5021. - Drop obsolete `version: '3.8'` from docker-compose.yml. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
38
.dockerignore
Normal file
38
.dockerignore
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# Version control
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Python caches / virtualenvs
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*.egg-info/
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
.pytest_cache/
|
||||||
|
.coverage
|
||||||
|
htmlcov/
|
||||||
|
|
||||||
|
# Local environment / secrets — never bake into the image
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
openrouter_key.txt
|
||||||
|
|
||||||
|
# Editor / OS
|
||||||
|
.DS_Store
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# Local runtime data (mounted as volumes in docker-compose, not baked in)
|
||||||
|
data/
|
||||||
|
backups/
|
||||||
|
app.log
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
||||||
|
|
||||||
|
# Docker artifacts
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
.dockerignore
|
||||||
|
|
||||||
|
# Docs / design notes not needed at runtime
|
||||||
|
*.md
|
||||||
33
.env.example
Normal file
33
.env.example
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# BalanceBoard environment configuration
|
||||||
|
# Copy this file to .env and edit values for your deployment:
|
||||||
|
# cp .env.example .env
|
||||||
|
|
||||||
|
# --- Flask ---
|
||||||
|
# Secret key for session signing. CHANGE THIS in production (use a long random string).
|
||||||
|
SECRET_KEY=change-this-secret-key-in-production
|
||||||
|
|
||||||
|
# Allow browsing the public feed without an account (true/false).
|
||||||
|
ALLOW_ANONYMOUS_ACCESS=true
|
||||||
|
|
||||||
|
# App branding (optional).
|
||||||
|
APP_NAME=BalanceBoard
|
||||||
|
LOGO_PATH=logo.png
|
||||||
|
|
||||||
|
# --- Database ---
|
||||||
|
# A full SQLAlchemy URI takes precedence over the POSTGRES_* vars below.
|
||||||
|
# Example: postgresql+psycopg2://balanceboard:balanceboard123@localhost:5432/balanceboard
|
||||||
|
DATABASE_URL=
|
||||||
|
|
||||||
|
# Used when DATABASE_URL is empty. docker-compose sets these for the app container;
|
||||||
|
# for local dev, point these at your own PostgreSQL instance.
|
||||||
|
POSTGRES_HOST=localhost
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
POSTGRES_USER=balanceboard
|
||||||
|
POSTGRES_PASSWORD=balanceboard123
|
||||||
|
POSTGRES_DB=balanceboard
|
||||||
|
|
||||||
|
# --- Auth0 (optional; leave blank to disable OAuth login) ---
|
||||||
|
AUTH0_DOMAIN=
|
||||||
|
AUTH0_CLIENT_ID=
|
||||||
|
AUTH0_CLIENT_SECRET=
|
||||||
|
AUTH0_AUDIENCE=
|
||||||
37
README.md
37
README.md
@@ -58,26 +58,41 @@ A Reddit-style content aggregator that collects posts from multiple platforms (R
|
|||||||
```
|
```
|
||||||
|
|
||||||
7. **Access the application**
|
7. **Access the application**
|
||||||
- Open browser to `http://localhost:5000`
|
- Open browser to `http://localhost:5021`
|
||||||
- Create an account or browse anonymously
|
- Create an account or browse anonymously
|
||||||
|
|
||||||
### Docker Deployment
|
### Docker Deployment
|
||||||
|
|
||||||
1. **Build the image**
|
The included `docker-compose.yml` runs the app plus a PostgreSQL database, with persistent volumes for the database, collected posts, and backups.
|
||||||
|
|
||||||
|
1. **Configure environment**
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
# Edit .env — at minimum set SECRET_KEY to a long random string
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Build and start the stack**
|
||||||
|
```bash
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Access the application**
|
||||||
|
- Open browser to `http://localhost:5021`
|
||||||
|
- Create an account or browse anonymously
|
||||||
|
|
||||||
|
Useful commands:
|
||||||
|
```bash
|
||||||
|
docker compose logs -f app # follow app logs
|
||||||
|
docker compose down # stop the stack (keeps data volumes)
|
||||||
|
docker compose down -v # stop and delete all data volumes
|
||||||
|
```
|
||||||
|
|
||||||
|
To publish the image to the registry instead of building locally:
|
||||||
```bash
|
```bash
|
||||||
docker build -t git.scorpi.us/chelsea/balanceboard:latest .
|
docker build -t git.scorpi.us/chelsea/balanceboard:latest .
|
||||||
```
|
|
||||||
|
|
||||||
2. **Push to registry**
|
|
||||||
```bash
|
|
||||||
docker push git.scorpi.us/chelsea/balanceboard:latest
|
docker push git.scorpi.us/chelsea/balanceboard:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Deploy with docker-compose**
|
|
||||||
```bash
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
See [DEPLOYMENT.md](DEPLOYMENT.md) for detailed deployment instructions.
|
See [DEPLOYMENT.md](DEPLOYMENT.md) for detailed deployment instructions.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
|
|||||||
Reference in New Issue
Block a user