-
Copy .env from .env.template
cp .env.template .env
-
Edit your .env file. Please see Env section for detail.
-
Build docker image by docker-compose
docker-compose build
- Run a web & db server.
$ docker-compose up
- Run db migration
$ docker-compose run coin-web pipenv run python manage.py migrate
- .env
name | description |
---|---|
DB_PASS | password for database login |
- command
$ docker-compose run coin-web pupenv run python manage.py startapp [application name]
sample-web: # [application name]-web
extends:
file: parent.yml
service: web
volumes: # mount application volume to /code directory.
- ./app/coin:/code/coin
ports:
- "8099:8000" # Describe unused port for other application. Container port have to be 8000.
environment:
APP_LIST: "payment" # [application name]. Separated by comma.
depends_on:
- db
- Run all test
$ docker-compose run coin-web pipenv run python manage.py test
- Run application test
$ docker-compose run [application name]-web pipenv run python manage.py test [application name]
- Login Postresql
- Login password is described on .env file.
$ docker-compose run db psql -h db -U postgres