-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (37 loc) · 1.13 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
FROM python:3.11.4-slim-bullseye
ARG PLUGINPATH
ARG CMD_ENTRYPOINT
# Set environment variables
ENV PATH=/root/.local/bin:$PATH \
FLIT_ROOT_INSTALL=1
# Set the working directory in the container to /app
WORKDIR /app
COPY src/ ./src/
RUN apt-get update; \
pip install flit; \
chmod -R 755 ./src/;
# Use Bash to handle the complex command
SHELL ["/bin/bash", "-c"]
RUN for subdir in ./src/*; do \
plugin=$(basename "$subdir"); \
if echo ":$PLUGINPATH:" | grep -q ":$plugin:" && [ -d "$subdir" ] && [ -e "$subdir/pyproject.toml" ]; then \
cd "$subdir"; \
if [ -e "install_system_dependencies.sh" ]; then \
chmod +x "install_system_dependencies.sh"; \
./install_system_dependencies.sh; \
fi; \
flit install; \
cd -; \
else \
rm -rf "$subdir"; \
fi; \
done
SHELL ["/bin/sh", "-c"]
RUN rm -rf ./src; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
EXPOSE 8888
ENV CMD_ENTRYPOINT=${CMD_ENTRYPOINT}
CMD ${CMD_ENTRYPOINT}
# # endless loop
# CMD ["sh", "-c", "while true; do sleep 30; done;"]