add Dockerfile spec

This commit is contained in:
aatish 2018-10-26 13:43:32 +05:45
parent 7a992a44d0
commit 28d061304f
5 changed files with 38 additions and 1 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
.git
*.pyc
db.sqlite3
venv/

16
Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM python:3-alpine3.6
ENV PYTHONUNBUFFERED=1
RUN apk add --no-cache linux-headers bash gcc \
musl-dev libjpeg-turbo-dev libpng libpq \
postgresql-dev uwsgi uwsgi-python3 git \
zlib-dev libmagic libffi-dev libressl-dev python3-dev
WORKDIR /site
ADD requirements.txt /site/
RUN pip install -U -r /site/requirements.txt
COPY ./ /site
CMD bash -c 'python3 manage.py migrate --noinput && python3 manage.py collectstatic --noinput && uwsgi --ini=/site/uwsgi.ini'

2
README.md Normal file
View file

@ -0,0 +1,2 @@
docker build -t ipv6dotwork .
docker run -d -p 8000:8000 --name ipv6dotwork ipv6dotwork

View file

@ -140,7 +140,13 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static/'), )
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles/')
MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles/')
MEDIA_URL = '/media/'
CRISPY_TEMPLATE_PACK = 'bootstrap4'

9
uwsgi.ini Normal file
View file

@ -0,0 +1,9 @@
[uwsgi]
module=ipv6work.wsgi:application
pythonpath=/usr/local/lib/python3.6/site-packages
static-map = /static=/site/staticfiles/
static-map = /media=/site/mediafiles/
http-socket=0.0.0.0:8000
processes=3
plugin=python3