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

chore: run container script run through CLI args #6690

Merged
merged 1 commit into from
Dec 23, 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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ WORKDIR /data/app
ADD . .

EXPOSE 8080
CMD ["sh", "scripts/container_start.sh"]
ENTRYPOINT ["sh", "scripts/container_start.sh"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ services:
container_name: opev-celery
environment:
<<: *environment-vars
DEPLOYMENT: celery
C_FORCE_ROOT: "true"
command: celery

volumes:
pg:
Expand Down
3 changes: 2 additions & 1 deletion scripts/container_start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
export DEPLOYMENT=${DEPLOYMENT:-api}
export DEPLOYMENT=${1:-api}

echo "[LOG] Deploying ${DEPLOYMENT}"
echo "[LOG] Using database: ${DATABASE_URL}"
Expand All @@ -18,6 +18,7 @@ then
echo "[LOG] Starting gunicorn on port ${PORT}"
gunicorn -b 0.0.0.0:${PORT} app:app -w $GUNICORN_WORKERS --enable-stdio-inheritance --log-level $GUNICORN_LOG_LEVEL --proxy-protocol --preload $GUNICORN_EXTRA_ARGS
fi

if [ "$DEPLOYMENT" == "celery" ]
then
echo "[LOG] Starting celery worker"
Expand Down