-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
108 lines (62 loc) · 2.81 KB
/
Dockerfile
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
FROM swipl:latest as prolog
FROM python:3.10
ENV DEBIAN_FRONTEND=noninteractive
RUN pip install --upgrade pip
RUN apt-get -y update
RUN pip3 install Django
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
git \
npm \
libtcmalloc-minimal4 \
libarchive13 \
libxml2-dev \
libxslt1-dev \
gcc \
wget \
unzip
WORKDIR /app
RUN set -eux; \
wget https://github.com/SWI-Prolog/sCASP/archive/refs/heads/master.zip ; \
unzip master.zip; \
mv sCASP-master sCASP; \
rm master.zip
COPY --from=prolog /usr/lib/swipl/ /usr/lib/swipl/
RUN ln -s /usr/lib/swipl/bin/x86_64-linux/swipl /usr/local/bin/swipl
RUN set -eux; \
cd sCASP; \
swipl -g "pack_install('.',[interactive(false)])" -t halt
COPY ./blawx/requirements.txt blawx/blawx/requirements.txt
RUN pip3 install -r blawx/blawx/requirements.txt
RUN mkdir blawx/blawx/static
RUN mkdir blawx/blawx/static/blawx
RUN mkdir blawx/blawx/static/blawx/blockly
RUN mkdir blawx/blawx/static/blawx/fonts
# RUN git clone https://github.com/google/blockly --branch develop blawx/blawx/static/blawx/blockly
RUN npm install blockly
RUN mv ./node_modules/blockly /app/blawx/blawx/static/blawx
RUN mkdir /app/blawx/blawx/static/blawx/blockly/appengine
RUN curl https://raw.githubusercontent.com/google/blockly/develop/appengine/storage.js > /app/blawx/blawx/static/blawx/blockly/appengine/storage.js
# RUN cp /blawx/blawx/static/blawx/blockly/msg/js/en.js /blawx/blawx/static/blawx/en.js
RUN npm install jquery
RUN mv ./node_modules/jquery/dist/jquery.min.js /app/blawx/blawx/static/blawx/jquery.min.js
RUN npm install bootstrap
RUN mv ./node_modules/bootstrap/dist/css/bootstrap.min.css /app/blawx/blawx/static/blawx/bootstrap.min.css
RUN mv ./node_modules/bootstrap/dist/css/bootstrap.min.css.map /app/blawx/blawx/static/blawx/bootstrap.min.css.map
RUN mv ./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js /app/blawx/blawx/static/blawx/bootstrap.bundle.min.js
RUN mv ./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map /app/blawx/blawx/static/blawx/bootstrap.bundle.min.js.map
RUN npm install bootstrap-icons
RUN mv ./node_modules/bootstrap-icons/font/bootstrap-icons.css /app/blawx/blawx/static/blawx/bootstrap-icons.css
RUN mv ./node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff /app/blawx/blawx/static/blawx/fonts/bootstrap-icons.woff
RUN mv ./node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2 /app/blawx/blawx/static/blawx/fonts/bootstrap-icons.woff2
COPY . blawx
WORKDIR /app/blawx
ARG SU_PASSWORD=blawx2022
ENV DJANGO_SUPERUSER_PASSWORD=$SU_PASSWORD
RUN python manage.py makemigrations
RUN python manage.py migrate --run-syncdb
RUN python manage.py createsuperuser --noinput --username admin --email admin@admin.com
RUN python load_data.py
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
EXPOSE 8000