Skip to content

Commit c411067

Browse files
committed
Change Dockerfile #2
1 parent ca38784 commit c411067

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ shell:
104104
@echo "------------------------------------------------------------------"
105105
@echo "Shelling in in production mode"
106106
@echo "------------------------------------------------------------------"
107-
@docker-compose exec django /bin/bash
107+
@docker-compose exec django bash
108108

109109
db-bash:
110110
@echo
@@ -218,7 +218,7 @@ devweb-shell:
218218
@echo "------------------------------------------------------------------"
219219
@echo "Run shell"
220220
@echo "------------------------------------------------------------------"
221-
@docker-compose exec dev /bin/bash
221+
@docker-compose exec dev bash
222222
# --------------- TESTS ---------------
223223
run-flake8:
224224
@echo

deployment/docker/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ ENV LANG en_ZA.UTF-8
3333
ENV LANGUAGE en_ZA:en
3434
ENV LC_ALL en_ZA.UTF-8
3535

36-
RUN apk add --no-cache --virtual .build-deps gcc libc-dev python3-dev linux-headers musl-dev libffi-dev py3-pip gdal \
37-
gettext curl-dev libressl-dev py3-yuicompressor git vim dpkg ca-certificates wget curl bash chromium
36+
RUN apk add --force-overwrite --no-cache --virtual .build-deps gcc libc-dev python3-dev linux-headers musl musl-dev \
37+
libffi-dev libressl-dev curl-dev tar \
38+
&& apk add --force-overwrite --no-cache gettext py3-pip py3-yuicompressor git vim ca-certificates wget curl \
39+
bash chromium gdal geos proj binutils \
40+
&& ln -s /usr/lib/libproj.so.15 /usr/lib/libproj.so \
41+
&& ln -s /usr/lib/libgdal.so.20 /usr/lib/libgdal.so \
42+
&& ln -s /usr/lib/libgeos_c.so.1 /usr/lib/libgeos_c.so
3843

3944
ADD deployment/docker/requirements.txt /requirements.txt
4045
RUN pip3 install --upgrade pip && pip install --upgrade pip
@@ -46,9 +51,7 @@ RUN pip install -r /requirements.txt
4651
## RUN bash nodesource_setup.sh
4752
#RUN apk add --force-overwrite --no-cache --virtual .build-deps nodejs -y
4853

49-
RUN wget https://unofficial-builds.nodejs.org/download/release/v18.9.1/node-v18.9.1-linux-x64-musl.tar.gz
50-
RUN tar -xvf node-v18.9.1-linux-x64-musl.tar.gz
51-
RUN rm node-v18.9.1-linux-x64-musl.tar.gz
54+
ADD /deployment/docker/node-v18.9.1-linux-x64-musl.tar.gz /node-v18.9.1-linux-x64-musl.tar.gz
5255

5356
RUN ln -s /var/www/node-v18.9.1-linux-x64-musl/bin/node /usr/bin/node
5457
RUN ln -s /var/www/node-v18.9.1-linux-x64-musl/bin/npm /usr/bin/npm
@@ -113,4 +116,6 @@ EXPOSE 8080
113116
# Open port 22 as we will be using a remote interpreter from pycharm
114117
EXPOSE 22
115118

119+
RUN ssh-keygen -A
120+
116121
CMD ["/usr/sbin/sshd", "-D"]
Binary file not shown.

django_project/core/settings/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
import os # noqa
1818

1919
from core.settings.utils import ABS_PATH
20+
from glob import glob
21+
22+
GDAL_LIBRARY_PATH = glob('/usr/lib/libgdal.so.*')[0]
23+
GEOS_LIBRARY_PATH = glob('/usr/lib/libgeos_c.so.*')[0]
2024

2125
# Local time zone for this installation. Choices can be found here:
2226
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
@@ -155,7 +159,7 @@
155159
LOGIN_URL = '/login/'
156160
SITE_ID = 1
157161

158-
SECRET_KEY = os.environ['SECRET_KEY']
162+
SECRET_KEY = 'deadbeef'
159163
if SECRET_KEY in ['', "''"]:
160164
raise Exception('SECRET_KEY is required in env.')
161165

0 commit comments

Comments
 (0)