Spaces:
Build error
Build error
Commit
·
3f4478d
1
Parent(s):
53645d7
Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Using python:3.9 as a base image
|
| 2 |
+
FROM python:3.9
|
| 3 |
+
|
| 4 |
+
# Setting up the necessary packages and dependencies
|
| 5 |
+
RUN apt-get update && \
|
| 6 |
+
apt-get install -y libpcre++-dev qttools5-dev qtbase5-dev libqt5svg5-dev libarchive-dev libpcre2-dev wget && \
|
| 7 |
+
wget https://github.com/XapaJIaMnu/translateLocally/releases/download/latest/translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb && \
|
| 8 |
+
dpkg -i translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb || true && \
|
| 9 |
+
apt-get install -f -y && \
|
| 10 |
+
rm translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb
|
| 11 |
+
|
| 12 |
+
# Setting up the working directory and adding a new user named "user"
|
| 13 |
+
WORKDIR /home/user/app
|
| 14 |
+
RUN useradd -m -u 1000 user
|
| 15 |
+
|
| 16 |
+
# Switching to the "user" user and setting environment variables
|
| 17 |
+
USER user
|
| 18 |
+
ENV HOME=/home/user \
|
| 19 |
+
PATH=/home/user/.local/bin:$PATH
|
| 20 |
+
|
| 21 |
+
# Installing the requirements
|
| 22 |
+
COPY requirements.txt .
|
| 23 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 24 |
+
|
| 25 |
+
# Copying the current directory contents into the container
|
| 26 |
+
COPY --chown=user . .
|
| 27 |
+
|
| 28 |
+
# Running the Flask application
|
| 29 |
+
CMD ["python", "app.py"]
|