Merge pull request #27 from bsquidwrd/fix_docker_run

Fix docker compile and run errors
This commit is contained in:
chibicitiberiu 2018-11-09 10:43:28 +02:00 committed by GitHub
commit 0b42cace8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
config/config.ini

View File

@ -4,15 +4,14 @@ Running with Docker
Sample Run command
-----
```bash
docker run -d --name ytsm -p 80:8000 --volume ./downloads:/usr/src/app/data/downloads chibicitiberiu/ytsm:latest
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
```
### Quick Rundown:
- `--expose 80:8000` maps the Host OS port 80 to the container port 80
- `--volume ./downloads:/usr/src/app/data/downloads` maps the downloads folder of the current directory to the container folder `downloads` (where you could set the program to download to)
- `--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`
- `chibicitiberiu/ytsm:latest` tells Docker which image to run the container with (in this case, the latest version)
**Note:** Replace `./downloads` in the command to where you want the downloads folder to be mapped to on the Host OS. Ex: `/path/to/host/download/folder:/path/to/container/download/folder`
Environment variables
-----
@ -23,8 +22,8 @@ Environment variables
Volumes
-----
- /usr/src/app/data/media
- /usr/src/app/data/db
- /usr/src/app/data
- /usr/src/app/config
Notes

View File

@ -126,11 +126,13 @@ CONFIG_DIR = os.path.join(PROJECT_ROOT, "config")
DATA_DIR = os.path.join(PROJECT_ROOT, "data")
STATIC_ROOT = os.path.join(PROJECT_ROOT, "static")
_DEFAULT_CONFIG_DIR = os.path.join(BASE_DIR, "default")
_DEFAULT_CONFIG_FILE = os.path.join(CONFIG_DIR, 'config.ini')
_DEFAULT_LOG_FILE = os.path.join(DATA_DIR, 'log.log')
_DEFAULT_MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
DEFAULTS_FILE = os.path.join(CONFIG_DIR, 'defaults.ini')
DEFAULTS_FILE = os.path.join(_DEFAULT_CONFIG_DIR, 'defaults.ini')
CONFIG_FILE = os.getenv('YTSM_CONFIG_FILE', _DEFAULT_CONFIG_FILE)
#