Fix Postgres version in docker files

This commit is contained in:
Ramon Wenger 2018-10-30 17:52:00 +01:00
parent 5b50e497c9
commit 457fc0d505
3 changed files with 5 additions and 4 deletions

View File

@ -14,7 +14,7 @@ Sources
* [Install](https://docs.pipenv.org/#install-pipenv-today) pipenv
* Create virtualenv in install dependencies `pipenv --python 3.6 install --dev`
* Create PostgreSQL database & user
* Create PostgreSQL database & user, needs to be version 10, not 11
* [Install](https://devcenter.heroku.com/articles/heroku-cli#download-and-install) Heroku cli, run `heroku login` and `heroku git:remote -a skillbox-hep`
* Create .env in `server` file with `SECRET_KEY` and `DATABASE_URL` (or copy the existing .env.example file)
* Migrate databases: `pipenv run python manage.py migrate`
@ -25,7 +25,7 @@ Sources
#### Dockerize DB
* To dockerize the DB, after installing docker, run the following command:
```
docker run --name skillboxdb -d -p 5432:5432 -e POSTGRES_PASSWORD=skillbox -e POSTGRES_USER=skillbox -e POSTGRES_DB=skillbox postgres:alpine
docker run --name skillboxdb -d -p 5432:5432 -e POSTGRES_PASSWORD=skillbox -e POSTGRES_USER=skillbox -e POSTGRES_DB=skillbox postgres:10-alpine
```
* After a reboot, start the container again with `docker start skillboxdb`

View File

@ -2,7 +2,7 @@ version: '3'
services:
db:
image: 'postgres'
image: 'postgres:10-alpine'
environment:
- POSTGRES_PASSWORD=skillbox
- POSTGRES_USER=skillbox
@ -14,6 +14,7 @@ services:
command: ["./wait-for-postgres.sh", "db", "python", "manage.py", "runserver", "0.0.0.0:8000"]
volumes:
- "./server:/app"
- "./client:/client"
ports:
- "8000:8000"
depends_on:

View File

@ -200,7 +200,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
Room.objects.all().delete()
root_page = Site.objects.get(is_default_site=True).root_page
# root_page = Site.objects.get(is_default_site=True, port=80).root_page
for room_idx, room_data in enumerate(data):
room = RoomFactory.create(**self.filter_data(room_data, ['entries']))