add docker files

This commit is contained in:
RubenPX 2022-03-17 17:40:02 +01:00
parent 5ab4779e1a
commit b83f369ea3
3 changed files with 61 additions and 0 deletions

36
borrador-dockerfile Normal file
View File

@ -0,0 +1,36 @@
FROM debian:stable-slim
CMD [ "bash" ]
# Variables de entorno
ENV DB_User="admin"
ENV DB_Email="ad@ad.ad"
ENV DB_Pass="admin"
# Instalar paquetes necesarios
RUN apt-get update
RUN apt-get install --no-install-recommends -y git python3-pip python3-setuptools python3-venv python3
# Creamos un usuario (django-orchestra no se ejecutará si somos root)
RUN useradd -ms /bin/bash -d /home/Ouser Ouser
USER Ouser
WORKDIR /home/Ouser/django
# Creamos el entorno de desarollo
ENV VENV_FOLDER=/home/Ouser/.venv
RUN python3 -m venv ${VENV_FOLDER}
RUN chmod +x ${VENV_FOLDER}/bin/activate
RUN . ${VENV_FOLDER}/bin/activate
# Instalamos django-admin y sus dependencias
RUN pip install wheel
COPY . .
RUN ${VENV_FOLDER}/bin/pip install -r requirements.txt
RUN ${VENV_FOLDER}/bin/pip install -e .
# Creamos el panel
# RUN [ "/bin/bash", "./.docker/setup.sh" ]
# Establacamos el punto de entrada de el contenedor de docker
ENTRYPOINT ["sh", "-c", "tail -f /dev/null"]
# ENTRYPOINT [ "./.docker/entrypoint.sh" ]

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
version: "3.9"
services:
web:
tty: true
build: .
ports:
- "9999:9999"

18
dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM debian:stable-slim
RUN apt-get -y update && apt-get install -y curl sudo git python3 python3-pip
RUN pip3 install -r https://raw.githubusercontent.com/ribaguifi/django-orchestra/master/requirements.txt
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 apt-get clean
WORKDIR /home/orchestra
COPY . .
RUN pip3 install -r requirements.txt
RUN pip3 install -e .
USER orchestra
RUN orchestra-admin startproject panel
ENTRYPOINT ["sh", "-c", "tail -f /dev/null"]