Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait-for-it.sh edited - ok #35

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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