diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c8a8b25 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,60 @@ +# wipeout wasm in docker +FROM debian:bullseye + +LABEL Greg Lebreton + +ENV ROOT_WWW_PATH /var/www/html + +RUN apt-get update && apt-get install -y \ + git \ + make \ + libx11-dev \ + libxcursor-dev \ + libxi-dev \ + libasound2-dev \ + ca-certificates \ + unzip \ + sed \ + p7zip-full \ + emscripten \ + coffeescript \ + xz-utils \ + nginx \ + wget \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# sinon le build failed +RUN emcc --version + +# clone repo git +RUN cd / \ + && git clone https://github.com/phoboslab/wipeout-rewrite.git \ + && cd wipeout-rewrite + +# copie des fichiers necessaires (wipeout-datas) +# COPY ./wipeout /wipeout-rewrite + +# wipeout datas +RUN cd /tmp \ + && wget https://phoboslab.org/files/wipeout-data-v01.zip \ + && unzip wipeout-data-v01.zip -d wipeout \ + && cp -r wipeout/* /wipeout-rewrite + +# build +RUN cd wipeout-rewrite \ + && make wasm + +# mise en place des fichiers +RUN cp /wipeout-rewrite/build/wasm/* /var/www/html \ + && cp /wipeout-rewrite/src/wasm-index.html /var/www/html/index.html \ + && cp -r /wipeout-rewrite/wipeout /var/www/html + + +WORKDIR ${ROOT_WWW_PATH} + +EXPOSE 80 + +COPY entrypoint.sh / + +CMD [ "sh", "/entrypoint.sh"] diff --git a/README.md b/README.md index a584d49..f3c0284 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,15 @@ The makefile accepts several flags. You can specify them with `make FLAG=VALUE` - `RENDERER` – `GL` or `SOFTWARE`, default is `GL` (the `SOFTWARE` renderer is very much unfinished and only works with SDL) - `USE_GLX` – `true` or `false`, default is `false` and uses `GLVND` over `GLX`. Only used for the linux build. +## Docker + +``` +docker build -t wipeout:1.0 . +docker run --name wipeout -p 80:80 wipeout:1.0 +``` + +> http://localhost + ## Running diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..fd1802e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1 @@ +nginx -g "daemon off;" \ No newline at end of file