Skip to content

Commit

Permalink
wait-for-it.sh edited - ok
Browse files Browse the repository at this point in the history
  • Loading branch information
marlluslustosa committed Dec 17, 2019
1 parent ad7c787 commit 52c447e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions frontend/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ 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 \
&& service nginx reload

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

0 comments on commit 52c447e

Please sign in to comment.