Test2 / Dockerfile
johnpaulbin's picture
Update Dockerfile
41bf20d
raw
history blame
1.49 kB
# Use the official Python 3.9 image
FROM python:3.9
# Set the working directory to /code
WORKDIR /code
# Copy the current directory contents into the container at /code
COPY ./requirements.txt /code/requirements.txt
# Install necessary Ubuntu packages and a deb package from a URL
RUN apt-get update && \
apt-get install -y sudo wget && \
sudo apt-get install -y libxkbcommon-x11-dev libpcre++-dev libvulkan-dev libgl1-mesa-dev qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools qt6-translations-l10n libqt6svg6-dev libarchive-dev libpcre2-dev wget && \
dpkg -i translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb || true && \
sudo apt-get install -f -y
# Install requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
RUN wget "https://github.com/XapaJIaMnu/translateLocally/releases/download/latest/translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb"
RUN dpkg -x translateLocally-v0.0.2+136745e-Ubuntu-20.04.AVX.deb .
# Running the Flask application
CMD ["python", "app.py"]