From 0d9ec2f3afb17edbcdb9f0c936ef145c8c4008f3 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Fri, 8 Jul 2016 10:04:42 -0600 Subject: [PATCH] Development Docker. --- Dockerfile | 14 ++++++++++++++ docker-compose.dev.yml | 15 +++++++++++++++ docker-compose.yml | 20 ++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.dev.yml create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b3b8d1d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.5 +RUN apt-get update +RUN apt-get install -y nodejs npm +RUN ln -s /usr/bin/nodejs /usr/bin/node +RUN mkdir /code +WORKDIR /code +RUN mkdir requirements +ADD bikeshop_project /code +COPY requirements /code/requirements +RUN pip install -r requirements/development.txt +RUN npm install +EXPOSE 8000:8000 +EXPOSE 3000:3000 +CMD python manage.py runserver 0.0.0.0:8000 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..3bf8d18 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,15 @@ +version: "2" +services: + workstand: + build: + context: ./Dockerfile + command: "bash -c 'npm run watch & python manage.py runserver 0.0.0.0:8000'" + ports: + - "8000:8000" + - "3000:3000" + volumes: + - ./bikeshop_project:/code + redis: + restart: always + db: + restart: always diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c34465f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "2" +services: + workstand: + image: bcbc/workstand + depends_on: + - redis + - db + links: + - redis + - db + redis: + image: redis:latest + db: + image: postgres:latest + volumes: + - pgdata:/var/lib/postgresql/data/ + +volumes: + pgdata: + external: false