Skip to content

Commit

Permalink
Start working on a configuration usable for development
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed May 17, 2024
1 parent 75879ca commit 0b50154
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DJANGO_DEBUG=False
WGER_USE_GUNICORN=False
EXERCISE_CACHE_TTL=30
SYNC_EXERCISES_ON_STARTUP=False

AXES_ENABLED=False

# Note: this is the path *within* the docker container
DJANGO_DB_ENGINE=django.db.backends.sqlite3
DJANGO_DB_DATABASE=/home/wger/src/database.sqlite
18 changes: 18 additions & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Development compose file for wger - WIP

## First start

```shell
UID=${UID} GID=${GID} docker compose up
docker compose exec web /bin/bash
cp extras/docker/development/settings.py .

wger bootstrap
python3 manage.py migrate
```

## Usage
```shell
UID=${UID} GID=${GID} docker compose up
python3 manage runserver 0.0.0.0:8000
```
52 changes: 52 additions & 0 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
services:

web:
image: wger/server:latest
container_name: wger_dev_server
user: "${UID}:${GID}"
env_file:
- ../config/prod.env
- ../config/dev.env
#- ../config/local.env
volumes:
- type: bind
source: /Users/roland/Entwicklung/wger/server
target: /home/wger/src
ports:
- "8000:8000"
# We use something here that never ends. The server is started manually
command: tail -f /dev/null

cache:
image: redis
container_name: wger_dev_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped

#db:
# image: postgres:15-alpine
# container_name: wger_dev_db
# environment:
# - POSTGRES_USER=wger
# - POSTGRES_PASSWORD=wger
# - POSTGRES_DB=wger
# expose:
# - 5432
# healthcheck:
# test: pg_isready -U wger
# interval: 10s
# timeout: 5s
# retries: 5
# start_period: 30s
# restart: unless-stopped

networks:
default:
name: wger_dev_network

0 comments on commit 0b50154

Please sign in to comment.