Compare commits

...

3 Commits

Author SHA1 Message Date
Damillora b48045956c Modify Dockerfile 2021-06-08 21:23:19 +07:00
Damillora 661d57ab56 Add initial Dockerfile 2021-06-08 21:20:26 +07:00
Damillora c086f10b3c Add robots 2021-06-08 15:23:30 +02:00
5 changed files with 38 additions and 1 deletions

1
.gitignore vendored
View File

@ -128,5 +128,4 @@ dmypy.json
# Pyre type checker
.pyre/
altessimo/production.py
/static/

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM python:alpine
ADD requirements.txt /app/requirements.txt
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add --no-cache mariadb-dev \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& apk add --no-cache mariadb-connector-c \
&& apk del build-deps
ADD . /app
WORKDIR /app
EXPOSE 8000
ENV DJANGO_SETTINGS_MODULE=altessimo.production
CMD ["gunicorn", "--bind", ":8000", "altessimo.wsgi"]

16
altessimo/production.py Normal file
View File

@ -0,0 +1,16 @@
from altessimo.settings import *
import os
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.getenv('ALTESSIMO_DB_NAME'),
'USER': os.getenv('ALTESSIMO_DB_USER'),
'PASSWORD': os.getenv('ALTESSIMO_DB_PASS'),
'HOST': os.getenv('ALTESSIMO_DB_HOST'),
}
}
ALLOWED_HOSTS = [ os.getenv('ALTESSIMO_WEB_URL') ]

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
Django>=3.0,<4.0
mysqlclient
gunicorn

2
robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-Agent: *
Disallow: /