File size: 3,531 Bytes
b48fd6f
 
 
 
 
 
 
 
 
 
28518f2
b48fd6f
 
 
 
 
 
 
 
 
 
 
69a0441
 
 
07fd15d
f2be1a4
b48fd6f
 
0e005fe
136b996
4a5a953
f22329d
 
4a01185
5de903a
fea69d5
4a01185
6312e92
b48fd6f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7175786
2db1682
7175786
b48fd6f
 
 
7175786
f3ccff3
4c69148
 
b48fd6f
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# See https://hub.docker.com/r/nikolaik/python-nodejs
#     https://github.com/nikolaik/docker-python-nodejs
# Default user is 'pn' with uid 1000, gid 1000
FROM nikolaik/python-nodejs:python3.10-nodejs18

# Install nginx and give permissions to 'pn'
# See https://www.rockyourcode.com/run-docker-nginx-as-non-root-user/
USER root

RUN apt-get -y update && apt-get -y install nginx wget curl zip 
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 libstdc++6 python3-launchpadlib software-properties-common -y
RUN mkdir -p /var/cache/nginx \
             /var/log/nginx \
             /var/lib/nginx
RUN touch /var/run/nginx.pid

RUN chown -R pn:pn /var/cache/nginx \
                       /var/log/nginx \
                       /var/lib/nginx \
                       /var/run/nginx.pid
RUN wget https://raw.githubusercontent.com/coder/code-server/refs/heads/main/install.sh
RUN bash install.sh
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update
RUN apt-get install --only-upgrade -y libstdc++6
RUN strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
RUN echo "c2VydmVyIHsgCiAgICBsaXN0ZW4gNTAwMCBkZWZhdWx0X3NlcnZlcjsgCiAgICBsaXN0ZW4gWzo6XTo1MDAwIGRlZmF1bHRfc2VydmVyOyAKCiAgICBzZXJ2ZXJfbmFtZSBfOyAKCgogICAgbG9jYXRpb24gLyB7CiAgICAgICAgIyBTZXJ2ZSBJQSBmcm9tIHBvcnQgCiAgICAgICAgcHJveHlfcGFzcyBodHRwOi8vbG9jYWxob3N0Ojc4NjA7CiAgICAgICAgcHJveHlfaHR0cF92ZXJzaW9uIDEuMTsKICAgICAgICBwcm94eV9zZXRfaGVhZGVyIFVwZ3JhZGUgJGh0dHBfdXBncmFkZTsKICAgICAgICBwcm94eV9zZXRfaGVhZGVyIENvbm5lY3Rpb24gJ3VwZ3JhZGUnOwogICAgICAgIHByb3h5X3NldF9oZWFkZXIgSG9zdCAkaG9zdDsKICAgICAgICBwcm94eV9zZXRfaGVhZGVyIFgtUmVhbC1JUCAkcmVtb3RlX2FkZHI7CiAgICAgICAgcHJveHlfc2V0X2hlYWRlciBYLUZvcndhcmRlZC1Gb3IgJHByb3h5X2FkZF94X2ZvcndhcmRlZF9mb3I7CiAgICAgICAgcHJveHlfc2V0X2hlYWRlciBYLUZvcndhcmRlZC1Ib3N0ICRob3N0OwogICAgICAgIHByb3h5X3NldF9oZWFkZXIgWC1Gb3J3YXJkZWQtUHJvdG8gJHNjaGVtZTsKICAgICAgICBwcm94eV9jYWNoZV9ieXBhc3MgJGh0dHBfdXBncmFkZTsKICAgICAgICBwcm94eV9yZWFkX3RpbWVvdXQgODY0MDA7CiAgICAgICAgcHJveHlfcmVkaXJlY3Qgb2ZmOwogICAgfQp9"| base64 --decode>hola.conf
RUN chmod 777 ./hola.conf
RUN cp ./hola.conf /etc/nginx/sites-available/default
ENV RETICULATE_MINICONDA_ENABLED=FALSE
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
RUN chmod 777 miniconda.sh
RUN export PATH="$PATH;/root/miniconda3/bin"
ENV PATH="$PATH;/root/miniconda3/bin"

RUN bash miniconda.sh -b
RUN cp /root/miniconda3/lib/libstdc++.so.6 /lib/x86_64-linux-gnu/libstdc++.so.6
RUN find /root/miniconda3 -name "libstdc++.so*"
RUN /root/miniconda3/bin/conda install -c conda-forge libstdcxx-ng=12
# Install dependencies and build app as non-root
USER pn
ENV HOME=/home/pn \
    PATH=/home/pn/.local/bin:$PATH

RUN mkdir $HOME/app

WORKDIR $HOME/app

COPY --chown=pn . .

RUN mkdir -p /var/cache/nginx \
             /var/log/nginx \
             /var/lib/nginx
RUN touch /var/run/nginx.pid

RUN chown -R pn:pn /var/cache/nginx \
                       /var/log/nginx \
                       /var/lib/nginx \
                       /var/run/nginx.pid


USER pn
RUN chmod +x install.sh
RUN bash install.sh>/dev/null
#RUN cp -a main/. fastsdcpu/
EXPOSE 5000
EXPOSE 7860
EXPOSE 7861
RUN echo "service nginx start\n#/usr/bin/code-server --bind-addr 0.0.0.0 --port 7860 --auth none&\npython src/app.py -w --port 7860">run.sh
RUN wget "https://civitai.com/api/download/models/1410435?type=Model&format=SafeTensor&size=pruned&fp=fp16" -O models/gguf/diffusion/ainsfwmodels.safetensors
RUN chmod 777 run.sh
CMD bash run.sh
#CMD bash run.sh