2018-10-31 15:57:32 +00:00
|
|
|
Running with Docker
|
|
|
|
===
|
|
|
|
|
|
|
|
Sample Run command
|
|
|
|
-----
|
|
|
|
```bash
|
2018-11-09 01:25:00 +00:00
|
|
|
docker run -d --name ytsm -p 80:8000 --volume /media/ytsm/data:/usr/src/ytsm/data --volume /media/ytsm/config:/usr/src/ytsm/config chibicitiberiu/ytsm:latest
|
2018-10-31 15:57:32 +00:00
|
|
|
```
|
|
|
|
### Quick Rundown:
|
|
|
|
- `--expose 80:8000` maps the Host OS port 80 to the container port 80
|
2018-11-09 01:27:44 +00:00
|
|
|
- `--volume /media/ytsm/data:/usr/src/app/data` maps the data folder on the host to the container folder `data`
|
|
|
|
- `--volume /media/ytsm/coinfig:/usr/src/app/config` maps the config folder on the host to the container folder `config`
|
2018-10-31 15:57:32 +00:00
|
|
|
- `chibicitiberiu/ytsm:latest` tells Docker which image to run the container with (in this case, the latest version)
|
|
|
|
|
|
|
|
|
|
|
|
Environment variables
|
|
|
|
-----
|
|
|
|
- YTSM_DATABASE_ENGINE
|
|
|
|
- YTSM_DATABASE_NAME
|
|
|
|
- YTSM_YOUTUBE_API_KEY
|
|
|
|
|
|
|
|
|
|
|
|
Volumes
|
|
|
|
-----
|
2018-11-03 20:46:01 +00:00
|
|
|
- /usr/src/app/data
|
|
|
|
- /usr/src/app/config
|
2018-10-31 15:57:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
Notes
|
|
|
|
----
|
|
|
|
If you experience any issues with the app running, make sure to run the following command to apply Django migrations to the database
|
|
|
|
|
|
|
|
### When using just the Dockerfile/Image
|
|
|
|
- `docker exec ytsm python manage.py migrate`
|
|
|
|
|
|
|
|
### When using the docker-compose file
|
|
|
|
- `docker exec ytsm_web_1 python manage.py migrate`
|