Skip to content

Commit 8550aa1

Browse files
committed
fix(docker): Allow docker to load configs
1 parent 27a7bc9 commit 8550aa1

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

Dockerfile

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,52 @@
11
FROM fukamachi/qlot:latest as build
2-
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt set -x; \
2+
3+
RUN --mount=type=cache,target=/var/cache/apt \
4+
--mount=type=cache,target=/var/lib/apt \
5+
set -x; \
36
apt-get update && \
47
apt-get install -y \
5-
make \
6-
libffi-dev \
7-
pkg-config \
8-
librabbitmq-dev \
9-
build-essential
8+
make \
9+
libffi-dev \
10+
pkg-config \
11+
librabbitmq-dev \
12+
build-essential
1013

1114
RUN ros setup
1215

1316
COPY . /root/
14-
17+
COPY .qlot /root/
1518
WORKDIR /root/
16-
RUN qlot install
17-
RUN qlot exec make build
19+
20+
RUN qlot exec sbcl --non-interactive \
21+
--load source/starintel-gserver.asd \
22+
--eval '(ql:quickload :starintel-gserver)' \
23+
--eval "(sb-ext:save-lisp-and-die \"star-server\" :toplevel 'star::main :executable t)"
24+
1825
RUN make install
26+
1927
FROM build as star-server
28+
29+
# Define a volume for configuration files
30+
VOLUME /config
31+
32+
# Old working config
2033
EXPOSE 5000
34+
#RUN echo '(:tree "/config/")' > /root/.config/common-lisp/source-registry.conf
35+
#ENTRYPOINT ["/root/star-server", "start", "-i", "/config/init.lisp"]
36+
# Create an entrypoint script
37+
RUN echo '#!/bin/sh\n\
38+
ls\n\
39+
echo "contents of /config"\n\
40+
ls -la /config \n\
41+
set -e\n\
42+
# Check if /config/init.lisp exists; if not, use /root/init.lisp\n\
43+
INIT_FILE="/config/init.lisp"\n\
44+
if [ ! -f "$INIT_FILE" ]; then\n\
45+
echo "/config/init.lisp not found. Using default /root/example_configs/init.lisp."\n\
46+
INIT_FILE="/root/example_configs/init.lisp"\n\
47+
fi\n\
48+
# Execute the server with the determined init file\n\
49+
exec ./star-server start -i "$INIT_FILE"' > /usr/local/bin/entrypoint.sh \
50+
&& chmod +x /usr/local/bin/entrypoint.sh
2151

22-
ENTRYPOINT ./star-server
23-
CMD [./star-server]
52+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
File renamed without changes.

0 commit comments

Comments
 (0)