This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (51 loc) · 1.86 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
FROM node:18.0.0 as build
SHELL ["/bin/bash", "-exo", "pipefail", "-c"]
ARG SSL_VERIFY=on
ENV SSL_VERIFY=$SSL_VERIFY
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y \
bash \
curl \
python3-pip \
sshpass git \
openssh-client \
vim \
jq && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
RUN if [[ "$SSL_VERIFY" == "off" ]]; then \
npm config set strict-ssl false -g; \
yarn config set "strict-ssl" false; \
fi
RUN npm install -g nodemon
# ENV NODE_HOME=/home/node
WORKDIR /setup
ADD . .
RUN yarn install --frozen lockfile
RUN yarn build
RUN if [[ "$SSL_VERIFY" == "off" ]]; then \
pip3 install --trusted-host=pypi.org --trusted-host=github.com \
--trusted-host=files.pythonhosted.org --upgrade pip; \
pip3 install --trusted-host=pypi.org --trusted-host=github.com \
--trusted-host=files.pythonhosted.org --upgrade setuptools 'pyinstaller>=5.7.0<6.0.0'; \
pip3 install --trusted-host=pypi.org --trusted-host=github.com \
--trusted-host=files.pythonhosted.org --upgrade .; \
else \
python3 -m pip install --upgrade pip; \
python3 -m pip install --upgrade setuptools 'pyinstaller>=5.7.0<6.0.0'; \
python3 -m pip install .; \
fi
RUN mv lessons.yaml.example lessons.yaml && pyinstaller -n bill \
--distpath dist \
--add-data bill.gui:bill.gui \
--add-data lessons.yaml:lessons.yaml \
$(sed -n '/^install_requires/,/^$/p' setup.cfg | sed -e 's/ //g' -e '1d;$d' -e 's/>.*//g' -e 's/=.*//g' -e 's/^\(.*\)/--hidden-import "\1"/g') \
--onedir bertdotbill/app.py
RUN pip install -t dist/bill .
FROM python:3.9-slim
COPY --from=build /setup/dist/bill /app
COPY entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /app
# ENV PATH=$NODE_HOME/bin:$NODE_HOME/.local/bin:$PATH
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]