|
1 | 1 | 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; \ |
3 | 6 | apt-get update && \
|
4 | 7 | 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 |
10 | 13 |
|
11 | 14 | RUN ros setup
|
12 | 15 |
|
13 | 16 | COPY . /root/
|
14 |
| - |
| 17 | +COPY .qlot /root/ |
15 | 18 | 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 | + |
18 | 25 | RUN make install
|
| 26 | + |
19 | 27 | FROM build as star-server
|
| 28 | + |
| 29 | +# Define a volume for configuration files |
| 30 | +VOLUME /config |
| 31 | + |
| 32 | +# Old working config |
20 | 33 | 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 |
21 | 51 |
|
22 |
| -ENTRYPOINT ./star-server |
23 |
| -CMD [./star-server] |
| 52 | +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
0 commit comments