TechDev commited on
Commit
6cbbec4
·
verified ·
1 Parent(s): 595c23e

Upload 3 files

Browse files
Files changed (2) hide show
  1. Dockerfile +25 -0
  2. requirements.txt +2 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y sudo && \
5
+ apt-get clean
6
+ RUN apt-get update && apt-get install -y python3 python3-pip python3.12-venv
7
+
8
+ # Añadir un usuario llamado 'appuser'
9
+ RUN useradd -ms /bin/bash appuser
10
+ RUN usermod -aG sudo appuser
11
+ RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
12
+
13
+ USER appuser
14
+
15
+ WORKDIR /app
16
+
17
+ COPY requirements.txt /app
18
+ COPY main.py /app
19
+
20
+ RUN sudo chmod -R 777 /app
21
+
22
+ RUN python3 -m venv venv
23
+ RUN /bin/bash -c "source venv/bin/activate && pip3 install -r requirements.txt"
24
+
25
+ CMD [ "venv/bin/gunicorn","-b","0.0.0.0:7860", "app:main"]
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ flask
2
+ gunicorn