Skip to content

Commit

Permalink
fix: make compose working.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Mehr committed Mar 21, 2024
1 parent 0527d47 commit 66d0556
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ RUN chmod +x /usr/src/app/wait_for_postgres.sh
RUN python manage.py collectstatic --noinput

# Run migrations
RUN /usr/src/app/wait_for_postgres.sh db python manage.py migrate
CMD /usr/src/app/wait_for_postgres.sh db python manage.py migrate
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ Open the http://localhost:8000 and it should be up, running and ready to use.

For adding seed data to the database, run the following command:

Firstly, run the migrations:
```bash
docker-compose exec web python manage.py migrate
```

Then, rerun the docker compose to make sure the database is up and running:

```bash
docker-compose up -d
```

Finally, run the seeder:

```bash
docker-compose exec web python manage.py seeder
docker-compose exec web python manage.py check_api
Expand All @@ -78,6 +91,7 @@ docker-compose exec web python manage.py check_api
### Installing for Contributors

After cloning the repository and navigating into the directory, install the dependencies using pip:

A step by step series of examples that tell you how to get a development environment running

```
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ services:
- REDIS_DB=0
web:
build: .
command: python manage.py runserver
command: python manage.py runserver 0.0.0.0:8989
volumes:
- .:/usr/src/app
ports:
- "8000:8000"
- "8989:8989"
environment:
- PYTHONUNBUFFERED=1
- POSTGRES_HOST=db
Expand Down

0 comments on commit 66d0556

Please sign in to comment.