-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 866 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.11.2
LABEL maintainer="Jose Arturo Fernandez <jarfernandez@aprenderdevops.com>"
# Se instala uWSGI y todas las librerias que necesita la aplicacion
COPY WebApp/requirements.txt requirements.txt
RUN pip install uwsgi && pip install -r requirements.txt
# Puerto HTTP por defecto para uWSGI
ARG UWSGI_HTTP_PORT=8000
ENV UWSGI_HTTP_PORT=$UWSGI_HTTP_PORT
# Aplicacion por defecto para uWSGI
ARG UWSGI_APP=webapp
ENV UWSGI_APP=$UWSGI_APP
# Se crea un usuario para arrancar uWSGI
RUN useradd -ms /bin/bash admin
USER admin
# Se copia el contenido de la aplicacion
COPY WebApp /WebApp
# Se copia el fichero con la configuración de uWSGI
COPY uwsgi.ini uwsgi.ini
# Se establece el directorio de trabajo
WORKDIR /WebApp
# Se crea un volumen con el contenido de la aplicacion
VOLUME /WebApp
# Se inicia uWSGI
ENTRYPOINT ["uwsgi", "--ini", "/uwsgi.ini"]