-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from dtekcth/less_hard_coding
Less hard coding
- Loading branch information
Showing
5 changed files
with
55 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
FROM python:3.7 | ||
ENV PYTHONUNBUFFERED 1 | ||
FROM python:3.7-slim | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
WORKDIR /code | ||
|
||
# Installs gettext tools so that localizations stuff works | ||
RUN apt-get update && apt-get install -y gettext libgettextpo-dev | ||
RUN apt-get update && apt-get install -y build-essential gettext libgettextpo-dev | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
COPY requirements.txt /code | ||
COPY requirements.txt ./ | ||
RUN pip install -r requirements.txt | ||
|
||
COPY dtekportal . | ||
COPY locale /locale | ||
COPY scripts /scripts | ||
|
||
RUN mkdir /logs | ||
|
||
ENV DB_HOST db | ||
ENV DB_PORT 5432 | ||
ENV PORT 80 | ||
EXPOSE $PORT | ||
CMD /scripts/wait-for-it.sh "$DB_HOST:$DB_PORT" -- \ | ||
uwsgi --http-socket ":$PORT" --module dtekportal.wsgi | ||
# Default values to match previous hardcoded values | ||
ENV DJANGO_ALLOWED_HOSTS="dtek.se,www.dtek.se" | ||
ENV DB_NAME="dtekportal" | ||
ENV DB_USER="postgres" | ||
ENV DB_HOST="db" | ||
ENV DB_PORT="5432" | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["uwsgi", "--socket", "0.0.0.0:3000", \ | ||
"--protocol", "uwsgi", \ | ||
"--module", "dtekportal.wsgi"] | ||
|
||
#CMD /scripts/wait-for-it.sh "$DB_HOST:$DB_PORT" -- \ | ||
# uwsgi --http-socket ":$PORT" --module dtekportal.wsgi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
server { | ||
listen 80; | ||
|
||
location / { | ||
include uwsgi_params; | ||
uwsgi_pass web:3000; | ||
} | ||
|
||
location /static/ { | ||
alias /usr/share/nginx/html/; | ||
index index.html index.htm; | ||
} | ||
|
||
location /robots.txt { | ||
alias /usr/share/nginx/html/robots.txt; | ||
} | ||
} |