Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +58 -0
Dockerfile
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# See https://hub.docker.com/r/nikolaik/python-nodejs
|
2 |
+
# https://github.com/nikolaik/docker-python-nodejs
|
3 |
+
# Default user is 'pn' with uid 1000, gid 1000
|
4 |
+
FROM nikolaik/python-nodejs:python3.10-nodejs18
|
5 |
+
|
6 |
+
# Install nginx and give permissions to 'pn'
|
7 |
+
# See https://www.rockyourcode.com/run-docker-nginx-as-non-root-user/
|
8 |
+
USER root
|
9 |
+
|
10 |
+
RUN apt-get -y update && apt-get -y install nginx wget curl zip
|
11 |
+
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
12 |
+
RUN mkdir -p /var/cache/nginx \
|
13 |
+
/var/log/nginx \
|
14 |
+
/var/lib/nginx
|
15 |
+
RUN touch /var/run/nginx.pid
|
16 |
+
|
17 |
+
RUN chown -R pn:pn /var/cache/nginx \
|
18 |
+
/var/log/nginx \
|
19 |
+
/var/lib/nginx \
|
20 |
+
/var/run/nginx.pid
|
21 |
+
RUN wget https://raw.githubusercontent.com/coder/code-server/refs/heads/main/install.sh
|
22 |
+
RUN bash install.sh
|
23 |
+
|
24 |
+
RUN echo "c2VydmVyIHsgCiAgICBsaXN0ZW4gNTAwMCBkZWZhdWx0X3NlcnZlcjsgCiAgICBsaXN0ZW4gWzo6XTo1MDAwIGRlZmF1bHRfc2VydmVyOyAKCiAgICBzZXJ2ZXJfbmFtZSBfOyAKCiAgICBsb2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Byb3h5X3NldF9oZWFkZXIgWC1Gb3J3YXJkZWQtRm9yICRwcm94eV9hZGRfeF9mb3J3YXJkZWRfZm9yOwogICAgICAgIHByb3h5X2NhY2hlX2J5cGFzcyAkaHR0cF91cGdyYWRlOwogICAgICAgIHByb3h5X3JlYWRfdGltZW91dCA4NjQwMDsKICAgICAgICBwcm94eV9yZWRpcmVjdCBvZmY7CiAgICB9Cn0=" | base64 --decode>hola.conf
|
25 |
+
RUN chmod 777 ./hola.conf
|
26 |
+
RUN cp ./hola.conf /etc/nginx/sites-available/default
|
27 |
+
# Install dependencies and build app as non-root
|
28 |
+
USER pn
|
29 |
+
ENV HOME=/home/pn \
|
30 |
+
PATH=/home/pn/.local/bin:$PATH
|
31 |
+
|
32 |
+
RUN mkdir $HOME/app
|
33 |
+
|
34 |
+
WORKDIR $HOME/app
|
35 |
+
|
36 |
+
COPY --chown=pn . .
|
37 |
+
|
38 |
+
RUN mkdir -p /var/cache/nginx \
|
39 |
+
/var/log/nginx \
|
40 |
+
/var/lib/nginx
|
41 |
+
RUN touch /var/run/nginx.pid
|
42 |
+
|
43 |
+
RUN chown -R pn:pn /var/cache/nginx \
|
44 |
+
/var/log/nginx \
|
45 |
+
/var/lib/nginx \
|
46 |
+
/var/run/nginx.pid
|
47 |
+
|
48 |
+
|
49 |
+
USER pn
|
50 |
+
RUN git clone https://github.com/rupeshs/fastsdcpu.git
|
51 |
+
RUN chmod +x fastsdcpu/install.sh
|
52 |
+
# RUN cd fastsdcpu;./install.sh;cd ..
|
53 |
+
EXPOSE 5000
|
54 |
+
EXPOSE 7860
|
55 |
+
EXPOSE 7861
|
56 |
+
RUN service nginx start
|
57 |
+
CMD /usr/bin/code-server --bind-addr 0.0.0.0 --port 7861 --auth none
|
58 |
+
#CMD bash run.sh
|