Skip to content

Commit f08085b

Browse files
author
Michael Roberts
committed
Added Dockerfile (Dockerfile defines an application’s image content via one or more build commands that configure that image), docker-compose.yml (which describes the services that make up this simple application) and requirements.txt (used by the RUN pip install -r requirements.txt command in the Dockerfile). Follow the instructions in the readme to setup and use Docker Compose to run this base Django/PostgreSQL application.
1 parent 8d13c84 commit f08085b

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3
2+
ENV PYTHONUNBUFFERED 1
3+
RUN mkdir /django-docker
4+
WORKDIR /django-docker
5+
ADD requirements.txt /django-docker/
6+
RUN pip install -r requirements.txt
7+
ADD . /django-docker/

docker-compose.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3'
2+
3+
services:
4+
db:
5+
image: postgres
6+
web:
7+
build: .
8+
command: python3 manage.py runserver 0.0.0.0:8000
9+
volumes:
10+
- .:/django-docker
11+
ports:
12+
- "8000:8000"
13+
depends_on:
14+
- db

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
django>=2.1
2+
psycopg2

0 commit comments

Comments
 (0)