How to Deploy a Static Site or WASM Game

Nginx serving static files with SPA fallback. Perfect for games, SPAs, and landing pages.

What you're building

A static site, single-page app, or WebAssembly game served by nginx with SPA fallback routing (all routes serve index.html).

Add a Dockerfile

FROM nginx:alpine

# Copy your static files
COPY . /usr/share/nginx/html

# nginx config template — $PORT is substituted at container start
RUN printf 'server {\n\
    listen ${PORT};\n\
    root /usr/share/nginx/html;\n\
    index index.html;\n\
    location / {\n\
        try_files $uri $uri/ /index.html;\n\
    }\n\
}\n' > /etc/nginx/conf.d/default.conf.template

EXPOSE $PORT
ENV PORT=8080
CMD ["/bin/sh", "-c", "envsubst '${PORT}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"]

How do I deploy it?

Step 1: Create the app

create_app(
  name: "my-game",
  github_repo: "github.com/me/my-game"
)

Step 2: If your files are in a subdirectory:

configure_app(app_name: "my-game", root_dir: "game")

Step 3: Deploy

deploy_app(app_name: "my-game", branch: "main")

Your site is live at https://my-game-dev.promptship.dev

WASM tip: Make sure your .wasm files are included in the build context. Add a .dockerignore that excludes .git/ and node_modules/ but keeps your WASM binaries.

Next steps