-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_app
More file actions
41 lines (27 loc) · 1.12 KB
/
Dockerfile_app
File metadata and controls
41 lines (27 loc) · 1.12 KB
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
32
33
34
35
36
37
38
39
40
41
# Use a base image with cuda from nvidia from docker hub and necessary dependencies for training
FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu20.04
# Install Python
RUN apt-get update && apt-get install -y python3 python3-pip sudo
# Add user called prgrmcode to container
RUN useradd -m prgrmcode
# Change the owner of the home folder of the user to prgrmcode
RUN chown -R prgrmcode:prgrmcode /home/prgrmcode/
# Create a folder for model pth files
RUN mkdir -p /home/prgrmcode/app/model
# Make the dir writable by prgrmcode
RUN chmod -R 777 /home/prgrmcode/app/model
# Copy the entire application project directory into the container
COPY --chown=prgrmcode application/ /home/prgrmcode/app/application/
# Change user to prgrmcode
USER prgrmcode
# Install requirements
RUN pip3 install --upgrade setuptools wheel pip
RUN pip3 install PyQt5==5.15.4
# for web api:
RUN pip3 install flask
RUN cd /home/prgrmcode/app/application/ && pip3 install -r requirements.txt
# Set the working directory
WORKDIR /home/prgrmcode/app/application
# Command to run the application script
CMD ["python3", "app.py"]
# CMD ["python3", "app_script.py"]