Skip to content

Commit 03cb401

Browse files
authored
Replace NGINX with Vite dev server in Docker setup (#777)
- Use Node.js runtime instead of OpenResty/NGINX - Clone isle.pizza frontend from master branch - Add entrypoint script that runs prepare:assets and starts Vite - Remove ISLE_EMSCRIPTEN_HOST build flag - Delete nginx.conf (no longer needed)
1 parent 4048e74 commit 03cb401

File tree

3 files changed

+23
-88
lines changed

3 files changed

+23
-88
lines changed

docker/emscripten/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,24 @@ COPY --chown=emscripten:emscripten packaging/ ./packaging/
3131
COPY --chown=emscripten:emscripten extensions/ ./extensions/
3232
COPY --chown=emscripten:emscripten CMakeLists.txt .
3333

34-
RUN emcmake cmake -S . -B build -DISLE_BUILD_CONFIG=OFF -DISLE_DEBUG=OFF -DCMAKE_BUILD_TYPE=Release -DISLE_EMSCRIPTEN_HOST=/assets && \
34+
RUN emcmake cmake -S . -B build -DISLE_BUILD_CONFIG=OFF -DISLE_DEBUG=OFF -DCMAKE_BUILD_TYPE=Release && \
3535
emmake cmake --build build -j 32
3636

3737
RUN echo "Fetching isle.pizza frontend..."; \
38-
git clone --depth 1 -b legacy https://github.com/isledecomp/isle.pizza /tmp/isle.pizza;
38+
git clone --depth 1 https://github.com/isledecomp/isle.pizza /tmp/isle.pizza;
3939

40-
FROM openresty/openresty:alpine
40+
FROM node:22-alpine
41+
42+
WORKDIR /app
43+
44+
COPY --from=builder /tmp/isle.pizza ./
45+
COPY --from=builder /src/build/isle.js /src/build/isle.wasm ./
46+
47+
RUN npm ci
48+
49+
COPY docker/emscripten/entrypoint.sh /entrypoint.sh
50+
RUN chmod +x /entrypoint.sh
4151

42-
COPY docker/emscripten/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
43-
COPY --from=builder /tmp/isle.pizza /usr/local/openresty/nginx/html
44-
COPY --from=builder /src/build/isle.* /usr/local/openresty/nginx/html
4552
EXPOSE 6931
53+
54+
ENTRYPOINT ["/entrypoint.sh"]

docker/emscripten/entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "Setting up LEGO Island assets..."
5+
npm run prepare:assets -- -f -p /assets
6+
7+
echo "Starting development server..."
8+
exec npm run dev -- --host 0.0.0.0 --port 6931

docker/emscripten/nginx.conf

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)