File size: 1,065 Bytes
3f4478d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Using python:3.9 as a base image
FROM python:3.9

# Setting up the necessary packages and dependencies
RUN apt-get update && \
    apt-get install -y libpcre++-dev qttools5-dev qtbase5-dev libqt5svg5-dev libarchive-dev libpcre2-dev wget && \
    wget https://github.com/XapaJIaMnu/translateLocally/releases/download/latest/translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb && \
    dpkg -i translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb || true && \
    apt-get install -f -y && \
    rm translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb

# Setting up the working directory and adding a new user named "user"
WORKDIR /home/user/app
RUN useradd -m -u 1000 user

# Switching to the "user" user and setting environment variables
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Installing the requirements
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copying the current directory contents into the container
COPY --chown=user . .

# Running the Flask application
CMD ["python", "app.py"]