Skip to content

Instantly share code, notes, and snippets.

@ferminhg
Last active June 22, 2020 10:21
Show Gist options
  • Save ferminhg/372fc30213e0e2d0bf13a1b01daa146f to your computer and use it in GitHub Desktop.
Save ferminhg/372fc30213e0e2d0bf13a1b01daa146f to your computer and use it in GitHub Desktop.
How-to run django-orchestra with docker

Pasos para ejecutar django-orchestra en docker

  1. git clone https://github.com/ribaguifi/django-orchestra
  2. Descargar Dockerfile https://gist.githubusercontent.com/ferminhg/372fc30213e0e2d0bf13a1b01daa146f/raw/fc51c83268763e74f5ade72be19aaf808edc4a5c/Dockerfile
  3. Build image: docker build -t orchestra .
  4. create orchestra
create --name orchestra -p 8000:8000 -v $HOME/projects/ribaguifi/django-orchestra:/home/orchestra/django-orchestra -i -t -u orchestra -w /home/orchestra orchestra bash

  1. start container: docker start orchestra
  2. attach container: docker attach orchestra
  3. Start panel project (inside docker) orchestra-admin startproject panel
  4. Chango orchestra library by our local code:
sudo mv /usr/local/lib/python3.6/site-packages/orchestra /usr/local/lib/python3.6/site-packages/orchestra_original
sudo ln -s /home/orchestra/django-orchestra/orchestra /usr/local/lib/python3.6/site-packages/orchestra 
  1. Start project
cd /home/orchestra
python3 panel/manage.py migrate
python3 panel/manage.py runserver 0.0.0.0:8000
  1. Open on your browser
http://localhost:8000/admin/
http://localhost:8000/swagger/
FROM python:3.6
RUN apt-get -y update && apt-get install -y curl sudo
RUN pip3 install wheel
RUN pip3 install https://github.com/ribaguifi/django-orchestra/tarball/dev/api-docs-swagger#egg=django-orchestra-dev
#RUN export TERM=xterm; curl -L http://git.io/orchestra-admin | bash -s install_requirements
RUN apt-get -y install python3-dev
RUN pip3 install -r https://raw.githubusercontent.com/ribaguifi/django-orchestra/dev/api-docs-swagger/requirements.txt
RUN apt-get clean
RUN useradd orchestra --shell /bin/bash && \
{ echo "orchestra:orchestra" | chpasswd; } && \
mkhomedir_helper orchestra && \
adduser orchestra sudo
RUN echo 'EXPORT $PATH="$PATH:/home/orchestra/.local/bin/"' > /home/orchestra/.bashrc
# RUN git clone https://github.com/ribaguifi/django-orchestra.git
# RUN orchestra-admin startproject panel
# RUN python3 panel/manage.py migrate
# RUN python3 panel/manage.py runserver
EXPOSE 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment