Skip to content

Instantly share code, notes, and snippets.

@SalahAdDin
Created September 17, 2016 23:56
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SalahAdDin/8163c255978b6fec45f94166c3f0ff61 to your computer and use it in GitHub Desktop.
Save SalahAdDin/8163c255978b6fec45f94166c3f0ff61 to your computer and use it in GitHub Desktop.
Django + Docker + Postgres + ElasticSearch + Redis recipe
version: '2'
services:
web:
build: .
image: uzman
command: python manage.py runserver 0.0.0.0:8000
ports:
- "3000:3000"
- "8000:8000"
volumes:
- .:/code
depends_on:
- npm
- sass
- migration
- db
- redis
- elasticsearch
db:
image: postgres:9.5.4
volumes:
- .:/tmp/data/
npm:
image: uzman
command: npm install
volumes:
- .:/code
elasticsearch:
image: elasticsearch:2.4.0
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "9200:9200"
- "9300:9300"
redis:
image: redis:3.2.3
sass:
image: uzman
command: gulp [principal task] #TODO: Add main task here
volumes:
- .:/code
migration:
image: uzman
command: python manage.py migrate --noinput
volumes:
- .:/code
FROM python:3.5.2
RUN apt-get update \
&& apt-get install -y gettext curl sudo \
&& curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - \
&& apt-get install -y nodejs \
&& apt-get install -y libpng-dev libtiff5-dev libjpeg62-turbo-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk \
libopenjpeg-dev pngquant libmagickwand-dev imagemagick \
&& apt-get autoremove -y --purge \
&& rm -rf /var/lib/apt/lists/*
# WORKDIR /tmp/
# RUN wget https://nodejs.org/dist/v6.5.0/node-v6.5.0-linux-x64.tar.xz \
# && tar xvf node-v6.5.0-linux-x64.tar.xz \
# && cp -rp node-v6.5.0-linux-x64/* /usr/local/ \
# && rm -rf node-v6.5.0-linux-x64.tar.xz node-v6.5.0-linux-x64/
# WORKDIR /usr/local/lib/
RUN mkdir /code
WORKDIR /code
RUN easy_install -U pip
RUN npm install -g autoprefixer gulpjs/gulp#4.0 node-sass susy # TODO: Verify in which folder packages are installed
ADD requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt
@marcelofern
Copy link

Could you tell me what is the reasoning behind image: uzman on those services? thx.

@SalahAdDin
Copy link
Author

it is my custom image for the app, when i use it in npm it means npm will use uzman as the base and it will handle it in other way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment