Dockerfile50 lines · 1433 chars FROM ruby:3.2-bookworm
LABEL maintainer="BuildAgent"
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
zsh \
lua5.4 \
git \
build-essential; \
# Be tolerant if /bin/zsh already points to /usr/bin/zsh
if [ -e /bin/zsh ]; then \
if [ "$(readlink -f /bin/zsh)" != "/usr/bin/zsh" ]; then \
ln -sf /usr/bin/zsh /bin/zsh; \
fi; \
:; \
else \
ln -s /usr/bin/zsh /bin/zsh; \
fi; \
ln -sf /usr/bin/lua5.4 /usr/bin/lua; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy project sources
COPY . .
# Prepare wax skeleton for stdlib compilation
RUN set -eux; \
mkdir -p wax/lib/build-scripts wax/lib/stdlib wax/bin wax/wax; \
if [ -d lib/build-scripts ]; then cp lib/build-scripts/compile-stdlib.sh wax/lib/build-scripts/compile-stdlib.sh; fi; \
if [ -f lib/build-scripts/luac.lua ]; then \
cp lib/build-scripts/luac.lua wax/lib/build-scripts/luac.lua; \
fi; \
if [ -d lib/stdlib ]; then cp -R lib/stdlib/* wax/lib/stdlib/; fi
ENV PROJECT_DIR=/app
# Ensure stdlib compile script has executable paths set
RUN chmod +x wax/lib/build-scripts/compile-stdlib.sh wax/lib/build-scripts/luac.lua 2>/dev/null || true
# Build the wax stdlib from source
RUN /bin/bash -lc "set -e; ./lib/build-scripts/compile-stdlib.sh" || true
# Default runtime shell
CMD ["/bin/bash"]