File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ FROM python:3.9.6-alpine
1818
1919RUN addgroup -S ocl && adduser -S ocl -G ocl
2020
21- ENV APP_HOME=/home/ocl/ code
21+ ENV APP_HOME=/code
2222
2323RUN mkdir -p $APP_HOME
2424WORKDIR $APP_HOME
@@ -33,14 +33,10 @@ ADD --chown=ocl:ocl . $APP_HOME
3333
3434USER 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+
3738RUN ["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
4440EXPOSE 8000
4541
4642CMD ["bash" , "-c" , "./startup.sh" ]
Original file line number Diff line number Diff line change @@ -8,9 +8,28 @@ The new and improved OCL terminology service v2
883 . 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
1635After modifying model you need to create migration files. Run:
Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ CELERY_WORKER_NAME=${CELERY_WORKER_NAME:-""}
66CELERY_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
You can’t perform that action at this time.
0 commit comments