Skip to content

Commit 92e900d

Browse files
committed
1 parent 7dad94f commit 92e900d

4 files changed

Lines changed: 26 additions & 15 deletions

File tree

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FROM python:3.9.6-alpine
1818

1919
RUN addgroup -S ocl && adduser -S ocl -G ocl
2020

21-
ENV APP_HOME=/home/ocl/code
21+
ENV APP_HOME=/code
2222

2323
RUN mkdir -p $APP_HOME
2424
WORKDIR $APP_HOME
@@ -33,14 +33,10 @@ ADD --chown=ocl:ocl . $APP_HOME
3333

3434
USER ocl
3535

36-
RUN chmod +x set_build_version.sh
36+
RUN chmod +x set_build_version.sh wait_for_it.sh startup.sh start_celery_worker.sh ping_celery_worker.sh start_flower.sh
37+
3738
RUN ["bash", "-c", "./set_build_version.sh"]
3839

39-
RUN chmod +x wait_for_it.sh
40-
RUN chmod +x startup.sh
41-
RUN chmod +x start_celery_worker.sh
42-
RUN chmod +x ping_celery_worker.sh
43-
RUN chmod +x start_flower.sh
4440
EXPOSE 8000
4541

4642
CMD ["bash", "-c", "./startup.sh"]

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,28 @@ The new and improved OCL terminology service v2
88
3. Go to http://localhost:8000/swagger/ to benefit.
99

1010
#### Run Checks
11-
1. Pylint (pep8) --- `docker exec -it oclapi2_api_1 pylint -j2 core`
12-
2. Coverage -- `docker exec -it oclapi2_api_1 bash coverage.sh`
13-
2. Tests --- `docker exec -it oclapi2_api_1 python manage.py test --keepdb -v3`
11+
(use the `docker exec` command in a service started with `docker-compose up -d`)
12+
1. Pylint (pep8):
13+
14+
`docker exec -it oclapi2_api_1 pylint -j2 core`
15+
16+
or
17+
18+
`docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api pylint -j0 core`
19+
2. Coverage
20+
21+
`docker exec -it oclapi2_api_1 bash coverage.sh`
22+
23+
or
24+
25+
`docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api bash coverage.sh`
26+
3. Tests
27+
28+
`docker exec -it oclapi2_api_1 python manage.py test --keepdb -v3`
29+
30+
or
31+
32+
`docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api python manage.py test --keepdb -v3`
1433

1534
### DB migrations
1635
After modifying model you need to create migration files. Run:

docker-compose.ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ services:
66
- ENVIRONMENT=ci
77
volumes:
88
- .:/code
9-
deploy:
10-
resources:
11-
limits:
12-
memory: 400m
139
celery:
1410
build: .
1511
volumes:

ping_celery_worker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ CELERY_WORKER_NAME=${CELERY_WORKER_NAME:-""}
66
CELERY_WORKER_NAME_WITH_UUID=`cat celery-worker-$CELERY_WORKER_NAME.tmp`
77

88
# Providing broker with -b is more efficient than -A as the app does not have to be initialized on each ping
9-
celery inspect ping -d "celery@$CELERY_WORKER_NAME_WITH_UUID" -b redis://${REDIS_HOST:-localhost}:${REDIS_PORT:-6379}/0
9+
celery inspect ping -t 10 -d "celery@$CELERY_WORKER_NAME_WITH_UUID" -b redis://${REDIS_HOST:-localhost}:${REDIS_PORT:-6379}/0

0 commit comments

Comments
 (0)