File size: 802 Bytes
0c20b62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM ubuntu

RUN apt-get update && \
    apt-get install -y sudo && \
    apt-get clean
RUN apt-get update && apt-get install -y python3 python3-pip python3.12-venv
RUN apt-get update && apt-get install -y \
    curl \
    ca-certificates \
    megatools \
    gnupg && \
    curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN rm -rf /var/lib/apt/lists/*

# Añadir un usuario llamado 'appuser'
RUN useradd -ms /bin/bash appuser
RUN usermod -aG sudo appuser
RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER appuser

WORKDIR /app

COPY . /app

RUN sudo chmod -R 777 /app

RUN python3 -m venv venv
RUN /bin/bash -c "source venv/bin/activate && pip3 install -r requirements.txt"

CMD ["venv/bin/gunicorn", "--worker-class", "eventlet", "-w", "1", "-b", "0.0.0.0:7860", "app:app"]