-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.basis
69 lines (60 loc) · 3.19 KB
/
Dockerfile.basis
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
FROM nginx:1.18-alpine
# 1. setup user and system software
RUN apk update &&\
apk add --no-cache gcc linux-headers make musl-dev python3-dev build-base libxml2 libxslt libxml2-dev libxslt-dev pcre-dev &&\
apk add --no-cache g++ &&\
apk add --update --no-cache python3 py-pip zip py3-virtualenv mariadb-dev npm git openssh-client libc6-compat pandas
# NOTE: We'll install it here, so rebuilding the image when testing application code is faster.
# If we install requirements after copying the code, the install layer has to be redone every time.
RUN python3 -m pip install --no-cache-dir wheel grpcio==1.36.1 protobuf uwsgi Django pyyaml grpcio-tools==1.36.1 requests randomname tqdm mysql mysqlclient python-gitlab GitPython django-webpack-loader==0.6.0 python-slugify markdown PyGithub ghapi parameterized approvaltests django-extensions
# 2. copy sources to temporary directory, enabling to install additional dependencies
RUN addgroup --gid 1010 tira && \
adduser --disabled-password --uid 1010 --ingroup tira tira && \
adduser tira root && \
mkdir /tira-tmp-debug && \
mkdir -p /tira/application/src/tira && \
mkdir -p /etc/nginx/logs && \
mkdir -p /mnt/ceph/tira && \
mkdir -p /root/.ir_datasets
COPY application/requirements.txt /tira-dependencies/
COPY application/src/tira/frontend /tira-dependencies/webpack-frontend
COPY frontend /tira-dependencies/vite-frontend
COPY protocol/build/python/* /tira/application/src/tira/proto/
COPY model/src/* /mnt/ceph/tira/model/
COPY application/src/tira_nginx.conf /etc/nginx/nginx.conf
COPY application/config/tira-application-config.docker.yml /tira/application/src/config/settings.yml
RUN chown -R tira:tira /usr/local && \
chmod 777 /var/run/ && \
echo "tira ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers &&\
touch /var/log/tira_debug.txt &&\
touch /tira/application/src/debug.log &&\
chown tira:tira /var/log/tira_debug.txt &&\
chown tira:tira /tira/application/src/debug.log &&\
chown -R tira:tira /root/.ir_datasets &&\
chmod 777 /root/.ir_datasets &&\
chmod 777 /root &&\
mkdir -p /home/tira/.tira &&\
mkdir -p /mnt/ceph/tira/log/tira-application &&\
mkdir /home/tira/.ssh &&\
mkdir /mnt/ceph/tira/state &&\
touch /mnt/ceph/tira/state/tira_vm_states.sqlite3 &&\
chown tira:tira -R /home/tira &&\
chown tira:tira -R /tira
# 3. install client dependencies
RUN apk add yarn && \
cd /tira-dependencies/vite-frontend && \
yarn install && yarn build && \
cd /tira-dependencies/webpack-frontend && \
npm install && \
cd /tira-dependencies && \
python3 -m pip install --no-cache-dir -r /tira-dependencies/requirements.txt && \
chown tira:tira -R /tira-dependencies && \
cd /tira-dependencies && \
rm -Rf src/ package-lock.json package.json requirements.txt tsconfig.json webpack-stats.json webpack.config.js && \
cd /tira-dependencies/webpack-frontend && \
rm -Rf src/ package-lock.json package.json requirements.txt tsconfig.json webpack-stats.json webpack.config.js && \
cd /tira-dependencies/vuetify-frontend && \
rm -Rf src/ package-lock.json package.json requirements.txt tsconfig.json webpack-stats.json webpack.config.js
RUN echo -e "http://dl-cdn.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/repositories && \
apk update && \
apk add podman fuse-overlayfs