prerobeny container webu na zdielany volume.. mozne menit kod a po restarte kontainera sa prejavia zmeny

This commit is contained in:
2025-03-23 19:33:16 +01:00
parent 3e8031da1d
commit 9fb64d0259
3 changed files with 9 additions and 4 deletions

View File

@@ -9,9 +9,9 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY requirements.txt ${APP_HOME}
COPY gunicorn-cfg.py ${APP_HOME}
COPY run.sh ${APP_HOME}
RUN chmod +x ${APP_HOME}/run.sh
#COPY gunicorn-cfg.py ${APP_HOME}
#COPY run.sh ${APP_HOME}
#RUN chmod +x ${APP_HOME}/run.sh
# install python dependencies

View File

@@ -36,6 +36,10 @@ services:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- .:/app:rw
- ./staticfiles:/app/static
- ./mediafiles:/app/media
command: bash -c 'cd /app && ./run.sh'
depends_on:
mysql:

3
run.sh Normal file → Executable file
View File

@@ -1,5 +1,6 @@
#!/bin/bash
cd src &&
python manage.py migrate &&
python manage.py fill_empty_db &&
gunicorn --config gunicorn-cfg.py kalskeborec.wsgi
gunicorn --config ../gunicorn-cfg.py kalskeborec.wsgi