El entorno de desarrollo esta configurado con docker siguiendo los pasos de los chicos de capisde
Prerequisites:
You will need to have docker installed at your system and running
Steps:
- Clone the repo
- Copy the env.example file to a new env file at the root of the project.
- Set the password for the database at the env file
- Build the containers:
docker-compose build - Run the containers:
docker-compose up -d - Test at your browser that
http://localhostis up and running.
Access to docker containers:
- 'docker ps' to get all containers information.
- 'docker exec -it "container_name"' to enter into the container.
Run manage.py:
- Enter to "etsy_web_1" container.
- 'cd' to "etsy/web/etsy/".
- 'python manage.py "command"'.
ATTENTION:
When docker-compose up, if database raises an error, check permissions in "postgres/docker-entrypoint-initdb.d/etsy_web.sh". Detected related error also when doing migrations.
If the problem persits, try to:
- Enter to the postgres container.
- psql -U postgres -c "CREATE USER $DB_USER PASSWORD '$DB_PASS'"
- psql -U postgres -c "CREATE DATABASE $DB_NAME OWNER $DB_USER"
- Exit postgres container, enter to web's one and create superuser with 'python3 manage.py createsuperuser'