Browse Source

add Dockerfile spec

master
Aatish Neupane 3 years ago
parent
commit
28d061304f
  1. 4
      .dockerignore
  2. 16
      Dockerfile
  3. 2
      README.md
  4. 6
      ipv6work/settings.py
  5. 9
      uwsgi.ini

4
.dockerignore

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

16
Dockerfile

@ -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

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

6
ipv6work/settings.py

@ -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/'
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

@ -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
Loading…
Cancel
Save