Skip to content

Commit 8ad324c

Browse files
committed
Refactor docker build
- Use QGIS Desktop 2.18 - Use entrypoint docker build command
1 parent a41a35f commit 8ad324c

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

deployment/ansible/development/group_vars/all.sample.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inasafe:
2020
depth: 1
2121

2222
inasafe_headless_worker:
23-
command: /docker-entrypoint.sh dev
23+
command: dev
2424
# Settings to specify broker url manually
2525
broker_url:
2626
# Optional settings to specify path mount

deployment/ansible/development/group_vars/all.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inasafe:
2020
depth: 1
2121

2222
inasafe_headless_worker:
23-
command: /docker-entrypoint.sh prod inasafe-headless-worker
23+
command: prod inasafe-headless-worker
2424
environment:
2525
task_always_eager: "${TASK_ALWAYS_EAGER}"
2626
on_travis: "${ON_TRAVIS}"

deployment/docker-headless/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#--------- Generic stuff all our Dockerfiles should start with so we get caching ------------
2-
FROM kartoza/qgis-desktop:LTR
2+
FROM kartoza/qgis-desktop:2.18
33

44
RUN apt-get -y update; apt-get -y --force-yes install pwgen git inotify-tools
55

@@ -37,4 +37,5 @@ ADD docker-entrypoint.sh /docker-entrypoint.sh
3737
RUN chmod +x /docker-entrypoint.sh
3838

3939
# Environment variable
40-
CMD ["/docker-entrypoint.sh", "prod", "inasafe-headless-worker"]
40+
ENTRYPOINT ["/docker-entrypoint.sh"]
41+
CMD ["prod", "inasafe-headless-worker"]

deployment/docker-headless/docker-entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ if [ $# -eq 2 ] && [ $1 = "prod" ] && [ $2 = "inasafe-headless-worker" ]; then
1313
elif [ $# -eq 1 ] && [ $1 = "dev" ]; then
1414
/usr/sbin/sshd -D
1515
fi
16+
17+
exec "$@"

deployment/production/docker/headless/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#--------- Generic stuff all our Dockerfiles should start with so we get caching ------------
2-
FROM kartoza/qgis-desktop:LTR
2+
FROM kartoza/qgis-desktop:2.18
33

44
RUN apt-get -y update; apt-get -y --force-yes install pwgen git inotify-tools
55

@@ -33,4 +33,5 @@ ARG INASAFE_HEADLESS_TAG=develop
3333
RUN git clone --branch ${INASAFE_HEADLESS_TAG} --depth 1 https://github.com/inasafe/inasafe-headless.git source
3434
RUN ln -s source/src/headless headless
3535

36-
CMD ["/docker-entrypoint.sh"]
36+
ENTRYPOINT ["/docker-entrypoint.sh"]
37+
CMD ["prod", "inasafe-headless-worker"]

deployment/production/docker/headless/docker-entrypoint.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ done
88

99
cp -n /home/app/headless/celeryconfig_sample.py /home/app/headless/celeryconfig.py
1010

11-
/usr/local/bin/celery -A headless.celery_app worker -l info -Q inasafe-headless -n inasafe-headless.%h
11+
if [ $# -eq 2 ] && [ $1 = "prod" ] && [ $2 = "inasafe-headless-worker" ]; then
12+
/usr/local/bin/celery -A headless.celery_app worker -l info -Q inasafe-headless -n inasafe-headless.%h
13+
elif [ $# -eq 1 ]; then
14+
/usr/local/bin/celery -A headless.celery_app worker -l info -Q inasafe-headless -n inasafe-headless.%h
15+
fi
16+
17+
exec "$@"

0 commit comments

Comments
 (0)