|
@@ -1,23 +1,21 @@
|
|
|
# yup, python 3.11!
|
|
# yup, python 3.11!
|
|
|
FROM python:3.11-slim
|
|
FROM python:3.11-slim
|
|
|
|
|
|
|
|
-# copy the django code
|
|
|
|
|
-COPY ./src ./app
|
|
|
|
|
-
|
|
|
|
|
# install nginx y otras cosas
|
|
# install nginx y otras cosas
|
|
|
-RUN apt-get update -y && \
|
|
|
|
|
- apt-get install nginx netcat-openbsd curl vim jq rsync libpango-1.0-0 libpangocairo-1.0-0 libcairo2 postgresql-client -y && \
|
|
|
|
|
- rm /etc/nginx/sites-enabled/default && \
|
|
|
|
|
- rm /etc/nginx/sites-available/default
|
|
|
|
|
|
|
+RUN apt-get update && apt-get install nginx netcat-openbsd curl vim jq rsync libpango-1.0-0 libpangocairo-1.0-0 libcairo2 postgresql-client -y
|
|
|
|
|
|
|
|
|
|
+# copy our nginx configuration to overwrite nginx defaults
|
|
|
|
|
+RUN rm /etc/nginx/sites-enabled/default
|
|
|
|
|
+RUN rm /etc/nginx/sites-available/default
|
|
|
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
|
# link nginx logs to container stdout
|
|
# link nginx logs to container stdout
|
|
|
-RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
|
|
|
|
|
- ln -sf /dev/stderr /var/log/nginx/error.log && \
|
|
|
|
|
- chgrp -R 0 ./app && \
|
|
|
|
|
- chmod -R g=u ./app && \
|
|
|
|
|
- chgrp -R 0 /var/lib/nginx && \
|
|
|
|
|
- chmod -R g=u /var/lib/nginx
|
|
|
|
|
|
|
+RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
|
|
|
|
+
|
|
|
|
|
+# copy the django code
|
|
|
|
|
+COPY ./src ./app
|
|
|
|
|
+
|
|
|
|
|
+RUN chgrp -R 0 ./app && chmod -R g=u ./app
|
|
|
|
|
+RUN chgrp -R 0 /var/lib/nginx && chmod -R g=u /var/lib/nginx
|
|
|
|
|
|
|
|
# change our working directory to the django projcet roo
|
|
# change our working directory to the django projcet roo
|
|
|
WORKDIR /app
|
|
WORKDIR /app
|
|
@@ -27,9 +25,14 @@ WORKDIR /app
|
|
|
# install requirements
|
|
# install requirements
|
|
|
RUN python -m venv /opt/venv && \
|
|
RUN python -m venv /opt/venv && \
|
|
|
/opt/venv/bin/python -m pip install pip --upgrade && \
|
|
/opt/venv/bin/python -m pip install pip --upgrade && \
|
|
|
- /opt/venv/bin/python -m pip install -r requirements.txt && \
|
|
|
|
|
- echo "export PATH=/opt/venv/bin/:$PATH" >> /root/.bashrc && \
|
|
|
|
|
- chmod +x config/entrypoint.sh
|
|
|
|
|
|
|
+ /opt/venv/bin/python -m pip install -r requirements.txt
|
|
|
|
|
+
|
|
|
|
|
+# Añade path a .bashrc
|
|
|
|
|
+
|
|
|
|
|
+RUN echo "export PATH=/opt/venv/bin/:$PATH" >> /root/.bashrc
|
|
|
|
|
+
|
|
|
|
|
+# make our entrypoint.sh executable
|
|
|
|
|
+RUN chmod +x config/entrypoint.sh
|
|
|
|
|
|
|
|
#EXPOSE 8080
|
|
#EXPOSE 8080
|
|
|
|
|
|