https://github.com/stevecassidy/races
Source for cabici.net
https://github.com/stevecassidy/races
Last synced: 5 months ago
JSON representation
Source for cabici.net
- Host: GitHub
- URL: https://github.com/stevecassidy/races
- Owner: stevecassidy
- License: apache-2.0
- Created: 2020-10-07T11:06:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-11-15T10:56:46.000Z (8 months ago)
- Last Synced: 2025-11-15T12:23:26.605Z (8 months ago)
- Language: Python
- Size: 5.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cabici
## Deployment
## Digital Ocean
Use docker to package the Django application.
To build:
```shell
docker build -f Dockerfile -t docker.pkg.github.com/stevecassidy/races/web:latest .
docker login docker.pkg.github.com -u stevecassidy -p
docker push docker.pkg.github.com/stevecassidy/races/web:latest
```
On the host:
```shell
docker login docker.pkg.github.com -u stevecassidy -p
docker pull docker.pkg.github.com/stevecassidy/races/web:latest
docker run -d --env-file env.prod -p 8000:8000 docker.pkg.github.com/stevecassidy/races/web:latest gunicorn --bind=0.0.0.0 races.wsgi
```
`.env.prod` contains the production configuration environment
Nginx installed on the Droplet routes traffic to the docker container.
Postgresql installed on the droplet serves the database.
Create database user with a password (under the postgres account):
```shell
createuser -P -s -e cabici
```
Create database (again as postgres):
```shell
createdb cabici
```
Restore database from backup (as root)
```shell
zcat cabici_pg-20201128.sql.gz | psql -U cabici -W --host=localhost
```
## Running Tests
```shell
docker-compose run web python bin/production.py test
```
## Development under Docker Compose
Run under docker componse to get a postgres database.
```shell
docker compose run -d
```
Should start web server on port 8000.
Restore database from backup into compose container:
```shell
docker compose exec -T db psql -U cabici -W --host=localhost < cabici_2023-01-01.Sunday.sql
```