Cahya Wirawan
commited on
Commit
•
017b3a2
1
Parent(s):
2f2a109
updated the dockerfile
Browse files- Dockerfile +12 -10
- app/start.sh +1 -1
Dockerfile
CHANGED
@@ -9,20 +9,22 @@ RUN apt-get update && apt-get install -y \
|
|
9 |
libgl1-mesa-glx curl nginx espeak-ng openssl libssl-dev libbz2-dev \
|
10 |
libncurses5-dev libreadline-dev \
|
11 |
&& rm -rf /var/lib/apt/lists/* && git lfs install
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
RUN pyenv install 3.8.9 && pyenv global 3.8.9 && pyenv rehash && \
|
14 |
pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
15 |
pip install --no-cache-dir datasets huggingface-hub "protobuf<4" "click<8.1"
|
16 |
-
COPY ./requirements.txt /home/user/requirements.txt
|
17 |
RUN pip install --no-cache-dir --upgrade -r /home/user/requirements.txt
|
18 |
-
COPY ./app /home/user/app
|
19 |
COPY ./default /etc/nginx/sites-available
|
20 |
-
RUN chown -R 1000 /var/log/nginx/ /var/lib/nginx/ /run/ /home/user/app/
|
21 |
-
#RUN mkdir -p /home/user/.config
|
22 |
-
#RUN chown -R 1000 /home/user/.config
|
23 |
-
#RUN chmod 777 /home/user/.config
|
24 |
-
#RUN mkdir -p /home/user/.cache
|
25 |
-
#RUN chown -R 1000 /home/user/.cache
|
26 |
-
#RUN chmod 777 /home/user/.cache
|
27 |
EXPOSE 7860
|
28 |
CMD ["/bin/sh", "/home/user/app/start.sh"]
|
|
|
9 |
libgl1-mesa-glx curl nginx espeak-ng openssl libssl-dev libbz2-dev \
|
10 |
libncurses5-dev libreadline-dev \
|
11 |
&& rm -rf /var/lib/apt/lists/* && git lfs install
|
12 |
+
|
13 |
+
RUN chown -R 1000 /var/log/nginx/ /var/lib/nginx/ /run/
|
14 |
+
USER user
|
15 |
+
ENV HOME /home/user
|
16 |
+
ENV PYENV_ROOT $HOME/.pyenv
|
17 |
+
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
|
18 |
+
|
19 |
+
|
20 |
+
RUN git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
|
21 |
+
#RUN curl https://pyenv.run | bash && \
|
22 |
RUN pyenv install 3.8.9 && pyenv global 3.8.9 && pyenv rehash && \
|
23 |
pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
24 |
pip install --no-cache-dir datasets huggingface-hub "protobuf<4" "click<8.1"
|
25 |
+
COPY --chown=user:user ./requirements.txt /home/user/requirements.txt
|
26 |
RUN pip install --no-cache-dir --upgrade -r /home/user/requirements.txt
|
27 |
+
COPY --chown=user:user ./app /home/user/app
|
28 |
COPY ./default /etc/nginx/sites-available
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
EXPOSE 7860
|
30 |
CMD ["/bin/sh", "/home/user/app/start.sh"]
|
app/start.sh
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
#!/usr/bin/env bash
|
2 |
set -e
|
3 |
|
4 |
-
cd /
|
5 |
|
6 |
id
|
7 |
ls -ld /var/log/nginx/ /var/lib/nginx/ /run
|
|
|
1 |
#!/usr/bin/env bash
|
2 |
set -e
|
3 |
|
4 |
+
cd /home/user/app
|
5 |
|
6 |
id
|
7 |
ls -ld /var/log/nginx/ /var/lib/nginx/ /run
|