Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
.gitignoreold
.dockerignore
.tool-versions
compose.yaml
compose.yml
docker-compose.yaml
docker-compose.yml
envs/
.venv/
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pypistats/
## Deployment

### Docker:
- Dockerfile and docker-compose.yml provided
- Dockerfile and compose.yaml provided
- docker-entrypoint.sh for container initialization

### Kubernetes:
Expand Down
2 changes: 1 addition & 1 deletion CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Web server configuration that uses:
- `WEB_CONCURRENCY` for worker count
- `LOG_LEVEL` for logging verbosity

### Docker Compose (`docker-compose.yml`)
### Docker Compose (`compose.yaml`)
Provides default values for local development:
- PostgreSQL: `admin`/`root` on port 5433
- Redis: port 6379
Expand Down
4 changes: 2 additions & 2 deletions ETL_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ docker compose exec postgresql psql -U admin -d pypistats -c "SELECT * FROM over
### Common Issues

1. **"GOOGLE_SERVICE_ACCOUNT_JSON environment variable is required"**
- Ensure the environment variable is set in docker-compose.yml or .env file
- Ensure the environment variable is set in compose.yaml or .env file
- The JSON must be a valid, complete service account key

2. **BigQuery Permission Denied**
Expand Down Expand Up @@ -172,7 +172,7 @@ BASIC_AUTH_PASSWORD=secret
PYPISTATS_SECRET=dev-secret-key
```

Then update docker-compose.yml to use the .env file:
Then update compose.yaml to use the .env file:
```yaml
x-envs: &envs
env_file: .env
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test:
docker compose run --build --rm --no-deps -T --entrypoint python web -m pytest -q \
--postgresql-host=postgresql --postgresql-port=5432 --postgresql-user=admin --postgresql-password=root

# launch the application in docker-compose
# launch the application in docker compose
.PHONY: pypistats
pypistats:
docker compose down
Expand Down
25 changes: 12 additions & 13 deletions docker-compose.yml → compose.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
x-envs: &envs
env_file: .env
environment:
- FLASK_APP=pypistats/run.py
- FLASK_ENV=development
- FLASK_DEBUG=1
- DATABASE_URL=${DATABASE_URL:-postgresql://admin:root@postgresql:5432/pypistats}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
- RATELIMIT_DEFAULT=${RATELIMIT_DEFAULT:-5 per second;30 per minute}
- BASIC_AUTH_USER=${BASIC_AUTH_USER:-user}
- BASIC_AUTH_PASSWORD=${BASIC_AUTH_PASSWORD:-password}
- PYPISTATS_SECRET=${PYPISTATS_SECRET:-dev-secret-key}
- GOOGLE_SERVICE_ACCOUNT_JSON=${GOOGLE_SERVICE_ACCOUNT_JSON:-}
FLASK_APP: pypistats/run.py
FLASK_ENV: development
FLASK_DEBUG: 1
DATABASE_URL: ${DATABASE_URL:-postgresql://admin:root@postgresql:5432/pypistats}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
BASIC_AUTH_USER: ${BASIC_AUTH_USER:-user}
BASIC_AUTH_PASSWORD: ${BASIC_AUTH_PASSWORD:-password}
PYPISTATS_SECRET: ${PYPISTATS_SECRET:-dev-secret-key}
GOOGLE_SERVICE_ACCOUNT_JSON: ${GOOGLE_SERVICE_ACCOUNT_JSON:-}

volumes:
pgdata: {}
Expand Down Expand Up @@ -82,9 +81,9 @@ services:
postgresql:
image: "postgres:16"
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=root
- POSTGRES_DB=pypistats
POSTGRES_USER: admin
POSTGRES_PASSWORD: root
POSTGRES_DB: pypistats
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 2s
Expand Down
Loading