$ docker pull xt1800i/snapnews-web
Please refer to this link
$ docker pull xt1800i/snapnews-web
make sure docker volume is mounted
$ docker run -itd -p 80:80 -v /media/storage/images:/media/storage/images --restart=always xt1800i/snapnews-web
get into docker bash
$ docker exec -it 'your docker container name' bash
edit /app/SnapNewsWeb/settings.py
Only Support MYSQL/MARIADB DO NOT USE OTHER DATABASE
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'database',
'USER': 'user',
'PASSWORD': 'password',
'HOST': 'host',
'PORT': 'port'
}
}
migrate database
# python3 manager.py makemigrations
# python3 manager.py migrate
restart container
$ docker restart 'your docker container name'
- make sure the image directory '/media/storage/images' exists