From 52c447eac0a5790d1c5face02e323ae3b9910363 Mon Sep 17 00:00:00 2001 From: Marllus Lustosa Date: Tue, 17 Dec 2019 11:19:11 -0300 Subject: [PATCH] wait-for-it.sh edited - ok --- Dockerfile | 5 +++-- docker-compose.yaml | 2 +- frontend/start.sh | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 42e68f2..cb134f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ RUN cp ./nginx/default.site-example /etc/nginx/sites-available/default \ RUN cd /var/lib/gems/2.5.0/gems/sass-3.4.22/lib/sass/ \ && sed -i "s/when\ Fixnum/when\ Integer/" util.rb -WORKDIR ./frontend +#WORKDIR ./frontend +RUN chmod +x ./wait-for-it.sh -ENTRYPOINT ["/bin/bash", "start.sh"] +#ENTRYPOINT ["/bin/bash", "start.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 228029b..f605839 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,7 +15,7 @@ services: image: politepol:latest depends_on: - 'dbpolitepol' - command: ["./wait-for-it.sh", "db:3306", "--", "/bin/bash", "./frontend/start.sh"] + command: ["./wait-for-it.sh", "dbpolitepol:3306", "--", "/bin/bash", "./frontend/start.sh"] container_name: politepol restart: unless-stopped networks: diff --git a/frontend/start.sh b/frontend/start.sh index 45d7198..f164bae 100644 --- a/frontend/start.sh +++ b/frontend/start.sh @@ -7,7 +7,7 @@ sed -i -E -e "s/(DEBUG = ).*/\1True/" \ -e "s/('HOST': ')127\.0\.0\.1(',)/\1${DB_HOST}\2/" \ -e "s/('PORT': ')3306(',)/\1${DB_PORT}\2/" \ -e "s/(TIME_ZONE = ').*/\1${TIME_ZONE}'/" \ - ./frontend/settings.py + ./frontend/frontend/settings.py sed -i -e 's/listen\ 80/listen\ '${WEB_PORT}'/g' \ -e 's/\[::\]:80/\[::\]:'${WEB_PORT}'/g' /etc/nginx/sites-available/default \ @@ -15,8 +15,8 @@ sed -i -e 's/listen\ 80/listen\ '${WEB_PORT}'/g' \ service nginx start > /dev/null -/usr/bin/python manage.py migrate -/usr/bin/python manage.py loaddata fields.json +/usr/bin/python ./frontend/manage.py migrate +/usr/bin/python ./frontend/manage.py loaddata fields.json -/usr/bin/python ../downloader.py & -/usr/bin/python manage.py runserver +/usr/bin/python ./downloader.py & +/usr/bin/python ./frontend/manage.py runserver