Skip to content
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
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ COPY config.json.sample config.json
RUN pip install -r /tmp/requirements.txt --no-cache-dir --ignore-installed

COPY --chown=app:root . .

FROM base as test
CMD ["python" "-m", "pytest", "-v", "--cov", "--disable-warnings" ]


FROM base as celery
COPY ./docker-entrypoint-celery.sh /tmp/entrypoint-celery.sh
ENTRYPOINT ["/tmp/entrypoint-celery.sh"]

FROM base as web
COPY ./docker-entrypoint.sh /tmp/entrypoint.sh
ENTRYPOINT ["/tmp/entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"reason8": "The request raised is incorrect or is not required for the reason supplied. Please re-raise with corrections.",
"reason9": "Please raise this via Group Access. Get in touch with your Lead/Manager to get yourself added to relevant Access Groups."
}
}
}
21 changes: 7 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@ services:
- 8000:8000
depends_on:
- db

command: >
/bin/bash -c "
while ! nc -z db 3306;
do
echo sleeping;
sleep 1;
done;
echo Connected!;"
bash -c "echo Starting Django runserver;
python manage.py runserver 0.0.0.0:8000"
db:
container_name: db
image: mysql/mysql-server:8.0.31
Expand All @@ -33,31 +27,30 @@ services:
- ./secrets/ops_mysql_dev.env
volumes:
- ./dbs:/var/lib/mysql --socket=/tmp/mysql.sock


redis:
container_name: redis
image: redis:alpine
command: --port 6379
ports:
- "6379:6379"

celery:
container_name: celery
build:
context: .
dockerfile: Dockerfile
target : celery
target: web
volumes:
- ./:/app/
env_file:
- ./secrets/ops_app_celery.env

depends_on:
- db
- redis
- web

command: >
bash -c "
echo Starting celery;
python3 -m celery -A BrowserStackAutomation worker -n worker1 -l DEBUG"
test:
container_name: test
build:
Expand Down
18 changes: 0 additions & 18 deletions docker-entrypoint-celery.sh

This file was deleted.

4 changes: 1 addition & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ tail -n 0 -f /ebs/logs/bstack.log &
python scripts/clone_access_modules.py
pip install -r Access/access_modules/requirements.txt --no-cache-dir --ignore-installed


echo Starting Django runserver.
python manage.py runserver 0.0.0.0:8000
eval "$@"