Skip to content

Instantly share code, notes, and snippets.

@a4amaan
Last active October 30, 2019 12:59
Show Gist options
  • Save a4amaan/a215ed42d40497023a6991ad3e1b2523 to your computer and use it in GitHub Desktop.
Save a4amaan/a215ed42d40497023a6991ad3e1b2523 to your computer and use it in GitHub Desktop.
Docker Setup Files for Django Project
version: '3'
services:
app:
build:
context: .
ports:
- "8000:8000"
volumes:
- .:/schoex
command: >
sh -c "python manage.py runserver 0.0.0.0:8000"
FROM python:3.7-alpine
MAINTAINER London App Developer Ltd.
ENV PYTHONUNBUFFERED 1
# Install dependencies
COPY requirements.txt ./
RUN pip install -r requirements.txt
# Setup directory structure
RUN mkdir /schoex
WORKDIR /schoex
COPY . .
RUN adduser -D user
USER user
Django>=2.1.0,<2.2.0
djangorestframework>=3.8.2,<3.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment