mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Optimize
This commit is contained in:
parent
115c9770e8
commit
3c1ec5c111
7
.github/workflows/docker.yml
vendored
7
.github/workflows/docker.yml
vendored
@ -1,14 +1,15 @@
|
||||
name: Publish web port Docker image
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
IMAGE_NAME: ${{ github.repository }}-emscripten
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
publish-emscripten:
|
||||
name: Publish web port
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@ -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
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
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 && \
|
||||
chmod +x /tmp/cmake.sh && \
|
||||
/tmp/cmake.sh --skip-license --prefix=/usr/local && \
|
||||
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
|
||||
|
||||
USER emscripten
|
||||
@ -35,6 +31,8 @@ RUN echo "Fetching isle.pizza frontend..."; \
|
||||
cp -r /tmp/isle.pizza/* /src/build/ && \
|
||||
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
|
||||
USER root
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Starting nginx web server on port 6931..."
|
||||
exec nginx -c /etc/nginx/nginx.conf
|
||||
@ -1,14 +1,8 @@
|
||||
daemon off;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
types {
|
||||
application/wasm wasm;
|
||||
}
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
server {
|
||||
@ -20,7 +14,7 @@ http {
|
||||
add_header 'Cross-Origin-Resource-Policy' 'cross-origin';
|
||||
|
||||
location / {
|
||||
root /src/build;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html isle.html;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user