Skip to content

Commit

Permalink
chore:run container script run through CLI args
Browse files Browse the repository at this point in the history
  • Loading branch information
codedsun committed Dec 23, 2019
1 parent 6a71e47 commit 6c3e7a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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

0 comments on commit 6c3e7a3

Please sign in to comment.