-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
44 changed files
with
195 additions
and
361 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/virtualenv | ||
/venv | ||
/results | ||
/etc | ||
**.pyc | ||
__pycache__ | ||
.env | ||
.git | ||
db.sqlite3 | ||
Makefile | ||
Dockerfile | ||
.coverage |
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,48 @@ | ||
FROM python:3.7 | ||
|
||
EXPOSE 8888 | ||
|
||
ENV DJANGO_SETTINGS_MODULE="config.settings.docker" | ||
|
||
ARG DJANGO_SECRET_KEY="notneededforbuilds" | ||
ARG DATABASE_URL="postgres://not@neededforbuilds" | ||
ARG MODEEMIUSERDB_URL="postgres://not@neededforbuilds" | ||
ARG RECAPTCHA_PUBLIC_KEY="notneededforbuilds" | ||
ARG RECAPTCHA_PRIVATE_KEY="notneededforbuilds" | ||
|
||
COPY scripts/entrypoint /usr/local/bin/entrypoint | ||
RUN chmod a+x /usr/local/bin/entrypoint | ||
|
||
WORKDIR /app | ||
|
||
ADD requirements.txt /app/requirements.txt | ||
RUN python -m pip install --no-cache-dir -r requirements.txt | ||
|
||
ADD . /app/ | ||
|
||
RUN python manage.py collectstatic --noinput | ||
|
||
RUN groupadd -g 1001 modeemintternet | ||
RUN useradd -u 1001 -g 1001 -d /app modeemintternet | ||
USER modeemintternet | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint"] | ||
CMD [ \ | ||
"gunicorn", \ | ||
"--name", \ | ||
"modeemintternet", \ | ||
"--access-logfile", \ | ||
"-", \ | ||
"--access-logform", \ | ||
"%({X-Forwarded-For}i)s %(l)s %(u)s %(t)s '%(r)s' %(s)s %(b)s '%(f)s' '%(a)s'", \ | ||
"--log-level", \ | ||
"info", \ | ||
"--workers", \ | ||
"2", \ | ||
"--bind", \ | ||
"0.0.0.0:8888", \ | ||
"config.wsgi:application" \ | ||
] | ||
|
||
ARG RELEASE | ||
ENV RELEASE=${RELEASE} |
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,28 @@ | ||
RELEASE := $$(git show -s --format=%H) | ||
IMAGE := modeemi/intternetvelho | ||
|
||
test: | ||
@echo "Running tests and linters" | ||
python manage.py test | ||
|
||
build: | ||
docker build --build-arg RELEASE=${RELEASE} -t ${IMAGE} . | ||
|
||
run: | ||
docker run ${IMAGE} | ||
|
||
push: | ||
docker push ${IMAGE} | ||
|
||
pull: | ||
docker pull ${IMAGE} | ||
|
||
default: | ||
make test | ||
|
||
all: | ||
make test | ||
make build | ||
make push | ||
|
||
.PHONY: all default test build push pull run |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
from .production import * # noqa | ||
|
||
|
||
STATIC_ROOT = '/app/static' |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.