Update Dockerfile
Browse files- Dockerfile +19 -15
Dockerfile
CHANGED
@@ -3,17 +3,27 @@
|
|
3 |
FROM python:3.9
|
4 |
|
5 |
RUN useradd -m -u 1000 user
|
6 |
-
USER user
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
ENV PATH="/home/user/.local/bin:/opt/conda/bin:$PATH"
|
10 |
ENV HOME="/home/user"
|
11 |
|
12 |
-
WORKDIR $HOME/app
|
13 |
|
14 |
|
15 |
-
RUN pip install --no-cache-dir --upgrade pip
|
16 |
-
RUN python3.9 -m pip install --upgrade pip
|
17 |
|
18 |
ARG PYTORCH_VERSION=2.1.0
|
19 |
ARG PYTHON_VERSION=3.9 #8.10
|
@@ -25,7 +35,6 @@ ARG INSTALL_CHANNEL=pytorch
|
|
25 |
# Automatically set by buildx
|
26 |
ARG TARGETPLATFORM
|
27 |
|
28 |
-
USER root
|
29 |
|
30 |
# Update basic dependencies we'll be using.
|
31 |
#RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
@@ -38,10 +47,7 @@ USER root
|
|
38 |
# git && \
|
39 |
# rm -rf /var/lib/apt/lists/*
|
40 |
|
41 |
-
|
42 |
-
# && cd teaching_arithmetic && pip install -e .
|
43 |
-
RUN chmod +x /teaching_arithmetic
|
44 |
-
USER 1000
|
45 |
#RUN teaching_arithmetic && pip install -e .
|
46 |
# Install conda
|
47 |
# translating Docker's TARGETPLATFORM into mamba arches
|
@@ -69,8 +75,6 @@ USER 1000
|
|
69 |
#RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
70 |
|
71 |
#COPY --chown=user teaching_arithmetic /teaching_arithmetic
|
72 |
-
COPY --chown=user . $HOME/app
|
73 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
74 |
#COPY . /app
|
75 |
#COPY ./out /out
|
76 |
#RUN chmod 777 -R /out
|
@@ -78,8 +82,8 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
78 |
#RUN chmod +x /out
|
79 |
#COPY ./out/addition_train /out/
|
80 |
#RUN chmod +x /teaching_arithmetic/train.py
|
81 |
-
|
82 |
-
|
83 |
|
84 |
|
85 |
# Expose the secret DEBUG at buildtime and use its value as git remote URL
|
@@ -91,5 +95,5 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
91 |
# USER 1000
|
92 |
|
93 |
|
94 |
-
#
|
95 |
-
ENTRYPOINT ["
|
|
|
3 |
FROM python:3.9
|
4 |
|
5 |
RUN useradd -m -u 1000 user
|
|
|
6 |
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
10 |
+
RUN pip install --no-cache-dir --upgrade pip
|
11 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
12 |
+
RUN python3.9 -m pip install --upgrade pip
|
13 |
+
RUN git clone https://github.com/lee-ny/teaching_arithmetic.git /teaching_arithmetic && cd teaching_arithmetic && pip install -e .
|
14 |
+
RUN chmod +x /teaching_arithmetic
|
15 |
+
|
16 |
+
COPY --chown=user . /app
|
17 |
+
|
18 |
+
USER user
|
19 |
|
20 |
ENV PATH="/home/user/.local/bin:/opt/conda/bin:$PATH"
|
21 |
ENV HOME="/home/user"
|
22 |
|
23 |
+
#WORKDIR $HOME/app
|
24 |
|
25 |
|
26 |
+
#RUN pip install --no-cache-dir --upgrade pip
|
|
|
27 |
|
28 |
ARG PYTORCH_VERSION=2.1.0
|
29 |
ARG PYTHON_VERSION=3.9 #8.10
|
|
|
35 |
# Automatically set by buildx
|
36 |
ARG TARGETPLATFORM
|
37 |
|
|
|
38 |
|
39 |
# Update basic dependencies we'll be using.
|
40 |
#RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
|
47 |
# git && \
|
48 |
# rm -rf /var/lib/apt/lists/*
|
49 |
|
50 |
+
|
|
|
|
|
|
|
51 |
#RUN teaching_arithmetic && pip install -e .
|
52 |
# Install conda
|
53 |
# translating Docker's TARGETPLATFORM into mamba arches
|
|
|
75 |
#RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
76 |
|
77 |
#COPY --chown=user teaching_arithmetic /teaching_arithmetic
|
|
|
|
|
78 |
#COPY . /app
|
79 |
#COPY ./out /out
|
80 |
#RUN chmod 777 -R /out
|
|
|
82 |
#RUN chmod +x /out
|
83 |
#COPY ./out/addition_train /out/
|
84 |
#RUN chmod +x /teaching_arithmetic/train.py
|
85 |
+
COPY ./train.sh /train.sh
|
86 |
+
RUN chmod +x /train.sh
|
87 |
|
88 |
|
89 |
# Expose the secret DEBUG at buildtime and use its value as git remote URL
|
|
|
95 |
# USER 1000
|
96 |
|
97 |
|
98 |
+
#CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
99 |
+
ENTRYPOINT ["/train.sh"]
|