diff --git a/borrador-dockerfile b/borrador-dockerfile new file mode 100644 index 00000000..40b74a7a --- /dev/null +++ b/borrador-dockerfile @@ -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" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..843ef53b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: "3.9" +services: + web: + tty: true + build: . + ports: + - "9999:9999" \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..fd31a961 --- /dev/null +++ b/dockerfile @@ -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"] \ No newline at end of file