This commit is contained in:
Christian Semmler 2025-07-01 12:51:41 -07:00
parent 115c9770e8
commit 3c1ec5c111
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
4 changed files with 12 additions and 25 deletions

View File

@ -1,14 +1,15 @@
name: Publish web port Docker image name: Docker
on: on:
push: push:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}-emscripten
jobs: jobs:
build-and-push-image: publish-emscripten:
name: Publish web port
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read

View File

@ -1,21 +1,17 @@
FROM emscripten/emsdk:latest FROM emscripten/emsdk:latest AS builder
ARG USE_ISLE_PIZZA=false
ARG CMAKE_VERSION=3.29.3 ARG CMAKE_VERSION=3.29.3
WORKDIR /src WORKDIR /src
USER root USER root
RUN apt-get update && apt-get install -y git wget nginx && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y git wget && rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh -O /tmp/cmake.sh && \ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh -O /tmp/cmake.sh && \
chmod +x /tmp/cmake.sh && \ chmod +x /tmp/cmake.sh && \
/tmp/cmake.sh --skip-license --prefix=/usr/local && \ /tmp/cmake.sh --skip-license --prefix=/usr/local && \
rm /tmp/cmake.sh rm /tmp/cmake.sh
COPY docker/emscripten/nginx.conf /etc/nginx/nginx.conf
COPY docker/emscripten/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN chown -R emscripten:emscripten /src RUN chown -R emscripten:emscripten /src
USER emscripten USER emscripten
@ -35,6 +31,8 @@ RUN echo "Fetching isle.pizza frontend..."; \
cp -r /tmp/isle.pizza/* /src/build/ && \ cp -r /tmp/isle.pizza/* /src/build/ && \
rm -rf /tmp/isle.pizza; rm -rf /tmp/isle.pizza;
FROM nginx:alpine
COPY docker/emscripten/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /src/build /usr/share/nginx/html
EXPOSE 6931 EXPOSE 6931
USER root
ENTRYPOINT ["entrypoint.sh"]

View File

@ -1,6 +0,0 @@
#!/bin/sh
set -e
echo "Starting nginx web server on port 6931..."
exec nginx -c /etc/nginx/nginx.conf

View File

@ -1,14 +1,8 @@
daemon off;
events { events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
types {
application/wasm wasm;
}
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
server { server {
@ -20,7 +14,7 @@ http {
add_header 'Cross-Origin-Resource-Policy' 'cross-origin'; add_header 'Cross-Origin-Resource-Policy' 'cross-origin';
location / { location / {
root /src/build; root /usr/share/nginx/html;
index index.html isle.html; index index.html isle.html;
try_files $uri $uri/ =404; try_files $uri $uri/ =404;
} }