Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3
ENV EMSCRIPTEN_VERSION=2.0.34
RUN pip3 install scons
WORKDIR /emscripten
RUN curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/${EMSCRIPTEN_VERSION}.tar.gz | tar --strip-components=1 -xvzf - && \
./emsdk install ${EMSCRIPTEN_VERSION} && \
./emsdk activate ${EMSCRIPTEN_VERSION}
WORKDIR /build
COPY . /build
RUN cd /emscripten && . /emscripten/emsdk_env.sh && cd /build && make js

FROM nginx:alpine
COPY --from=0 /build/apps/ /usr/share/nginx/html/
COPY --from=0 /build/build/ /usr/share/nginx/html/build/
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ You need to make sure you have both emscripten and sconstruct installed.

# Now see apps/simple-html/ to try the library in a browser.

Build the Docker version
------------------------

A `Dockerfile` is included that allows you to quickly build a functional
web engine for further development.

# compile the current source code
docker build -t webengine .

# run the web engine in a web server
docker run -it --rm -p 8080:80 webengine

Once running, browse to http://localhost:8080/simple-html/stellarium-web-engine.html
to open the web engine


Contributing
------------
Expand Down
6 changes: 4 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ VariantDir('build/ext_src', 'ext_src', duplicate=0)
env = Environment(variables=vars)

env.Append(CFLAGS= '-Wall -std=gnu11 -Wno-unknown-pragmas -D_GNU_SOURCE '
'-Wno-missing-braces',
'-Wno-missing-braces -Wno-unused-command-line-argument',
CXXFLAGS='-Wall -std=gnu++11 -Wno-narrowing '
'-Wno-unknown-pragmas -Wno-unused-function')
'-Wno-unknown-pragmas -Wno-unused-function '
'-Wno-unused-command-line-argument '
'-Wno-unused-but-set-variable')

if env['werror']:
env.Append(CCFLAGS='-Werror')
Expand Down
2 changes: 1 addition & 1 deletion apps/simple-html/stellarium-web-engine.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h3>{{getTitle(stel.core.selection)}}</h3>

// Force ui update when there is any change.
stel.change(function(obj, attr) {
if (attr !== "hovered") {
if (attr !== "hovered")
that.stel = Object.assign(Object.create(stel), {}, stel)
})

Expand Down