-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (28 loc) · 1.18 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
FROM node:23-bookworm-slim
RUN apt update
RUN apt install -y python3 python3-pip python3-venv
# create users
ARG UID=1000
ARG GID=1000
RUN userdel node
RUN groupadd -f -g $GID criticalmaas && useradd -ms /bin/bash criticalmaas -u $UID -g $GID
USER criticalmaas
ENV PATH="/home/criticalmaas/kg/.venv/bin:${PATH}"
# install libraries
RUN mkdir -p /home/criticalmaas/kg/minmod_editor && \
touch /home/criticalmaas/kg/minmod_editor/__init__.py
ADD pyproject.toml /home/criticalmaas/kg/
ADD poetry.lock /home/criticalmaas/kg/
ADD README.md /home/criticalmaas/kg/
RUN cd /home/criticalmaas/kg && python3 -m venv .venv && pip install .
RUN mkdir -p /home/criticalmaas/kg/www
ADD --chown=criticalmaas:criticalmaas www/package.json /home/criticalmaas/kg/www/
ADD --chown=criticalmaas:criticalmaas www/package-lock.json /home/criticalmaas/kg/www/
RUN cd /home/criticalmaas/kg/www && npm install
# add python code
ADD --chown=criticalmaas:criticalmaas minmod_editor /home/criticalmaas/kg/minmod_editor
# add www code
ADD --chown=criticalmaas:criticalmaas www /home/criticalmaas/kg/www
RUN cd /home/criticalmaas/kg/www && npm run build
WORKDIR /home/criticalmaas/kg/
CMD [ "python", "-m", "minmod_editor" ]