Fix Postgres version in docker files
This commit is contained in:
parent
5b50e497c9
commit
457fc0d505
|
|
@ -14,7 +14,7 @@ Sources
|
||||||
|
|
||||||
* [Install](https://docs.pipenv.org/#install-pipenv-today) pipenv
|
* [Install](https://docs.pipenv.org/#install-pipenv-today) pipenv
|
||||||
* Create virtualenv in install dependencies `pipenv --python 3.6 install --dev`
|
* 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`
|
* [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)
|
* 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`
|
* Migrate databases: `pipenv run python manage.py migrate`
|
||||||
|
|
@ -25,7 +25,7 @@ Sources
|
||||||
#### Dockerize DB
|
#### Dockerize DB
|
||||||
* To dockerize the DB, after installing docker, run the following command:
|
* 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`
|
* After a reboot, start the container again with `docker start skillboxdb`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: 'postgres'
|
image: 'postgres:10-alpine'
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_PASSWORD=skillbox
|
- POSTGRES_PASSWORD=skillbox
|
||||||
- POSTGRES_USER=skillbox
|
- POSTGRES_USER=skillbox
|
||||||
|
|
@ -14,6 +14,7 @@ services:
|
||||||
command: ["./wait-for-postgres.sh", "db", "python", "manage.py", "runserver", "0.0.0.0:8000"]
|
command: ["./wait-for-postgres.sh", "db", "python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||||
volumes:
|
volumes:
|
||||||
- "./server:/app"
|
- "./server:/app"
|
||||||
|
- "./client:/client"
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ class Command(BaseCommand):
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
Room.objects.all().delete()
|
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):
|
for room_idx, room_data in enumerate(data):
|
||||||
room = RoomFactory.create(**self.filter_data(room_data, ['entries']))
|
room = RoomFactory.create(**self.filter_data(room_data, ['entries']))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue