Skip to content

Commit

Permalink
Change Dockerfile #2
Browse files Browse the repository at this point in the history
  • Loading branch information
zamuzakki committed Sep 6, 2023
1 parent ca38784 commit c411067
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ shell:
@echo "------------------------------------------------------------------"
@echo "Shelling in in production mode"
@echo "------------------------------------------------------------------"
@docker-compose exec django /bin/bash
@docker-compose exec django bash

db-bash:
@echo
Expand Down Expand Up @@ -218,7 +218,7 @@ devweb-shell:
@echo "------------------------------------------------------------------"
@echo "Run shell"
@echo "------------------------------------------------------------------"
@docker-compose exec dev /bin/bash
@docker-compose exec dev bash
# --------------- TESTS ---------------
run-flake8:
@echo
Expand Down
15 changes: 10 additions & 5 deletions deployment/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ ENV LANG en_ZA.UTF-8
ENV LANGUAGE en_ZA:en
ENV LC_ALL en_ZA.UTF-8

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

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

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

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

RUN ssh-keygen -A

CMD ["/usr/sbin/sshd", "-D"]
Binary file not shown.
6 changes: 5 additions & 1 deletion django_project/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
import os # noqa

from core.settings.utils import ABS_PATH
from glob import glob

GDAL_LIBRARY_PATH = glob('/usr/lib/libgdal.so.*')[0]
GEOS_LIBRARY_PATH = glob('/usr/lib/libgeos_c.so.*')[0]

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

SECRET_KEY = os.environ['SECRET_KEY']
SECRET_KEY = 'deadbeef'
if SECRET_KEY in ['', "''"]:
raise Exception('SECRET_KEY is required in env.')

Expand Down

0 comments on commit c411067

Please sign in to comment.