From c28e1b2b054919a9b327a66dcfa0f3beb241ac28 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 27 Aug 2018 14:10:33 +0200 Subject: [PATCH] Add docker configuration --- Dockerfile | 12 ++++++++++++ Dockerfile.pythonnc | 2 ++ docker-compose.yml | 23 +++++++++++++++++++++++ Pipfile => server/Pipfile | 0 Pipfile.lock => server/Pipfile.lock | 0 5 files changed, 37 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerfile.pythonnc create mode 100644 docker-compose.yml rename Pipfile => server/Pipfile (100%) rename Pipfile.lock => server/Pipfile.lock (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8daf8d6e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM iterativ/python3_netcat +ENV PYTHONUNBUFFERED 1 +RUN mkdir /env +RUN mkdir /app + +RUN pip install pipenv + +ADD ./server/ /app/ +#RUN apt-get update && apt-get -y install netcat && apt-get clean +#RUN apt-get -y install netcat +WORKDIR /app +RUN pipenv install --system --deploy diff --git a/Dockerfile.pythonnc b/Dockerfile.pythonnc new file mode 100644 index 00000000..a137214a --- /dev/null +++ b/Dockerfile.pythonnc @@ -0,0 +1,2 @@ +FROM python:3.6 +RUN apt-get update && apt-get install -y netcat diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..393e8fef --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3' + +services: + db: + image: 'postgres' + environment: + - POSTGRES_PASSWORD=skillbox + - POSTGRES_USER=skillbox + - POSTGRES_DB=skillbox + volumes: + - helloclassdb:/var/lib/postgresql/data + web: + build: . + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - "./server:/app" + ports: + - "8000:8000" + depends_on: + - db + +volumes: + helloclassdb: \ No newline at end of file diff --git a/Pipfile b/server/Pipfile similarity index 100% rename from Pipfile rename to server/Pipfile diff --git a/Pipfile.lock b/server/Pipfile.lock similarity index 100% rename from Pipfile.lock rename to server/Pipfile.lock