Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Clean up asteroids demo (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry authored Jan 18, 2024
2 parents f35b5c2 + 7041c2f commit edd8506
Show file tree
Hide file tree
Showing 48 changed files with 2,945 additions and 789 deletions.
45 changes: 0 additions & 45 deletions html5/asteroids-socketio-canvas/Dockerfile

This file was deleted.

76 changes: 0 additions & 76 deletions html5/asteroids-socketio-canvas/rivet.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions javascript/asteroids-socketio-canvas/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# syntax=docker/dockerfile:1

# === Builder ===
FROM node:20-alpine AS build
WORKDIR /app/build
COPY package.json yarn.lock tsconfig.json ./
RUN yarn install --frozen-lockfile
COPY ./server ./server
COPY ./shared ./shared
RUN ls node_modules; yarn run build:server
RUN rm -rf ./node_modules

# === Runner ===
FROM node:20-alpine
ENV NODE_ENV=production
WORKDIR /app
COPY --from=build /app/build/package.json /app/build/yarn.lock ./
COPY --from=build /app/build/build/server ./
RUN yarn install --frozen-lockfile --production
RUN adduser -D server
USER server
CMD ["node", "-r", "module-alias/register", "server/index.js"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default interface ConnectionTarget {

export const RIVET = new RivetClient({
// @ts-ignore
token: import.meta.env.PROD ? undefined : import.meta.env.VITE_RIVET_DEV_TOKEN,
environment: process.env.RIVET_API_ENDPOINT,
// @ts-ignore
token: process.env.RIVET_TOKEN,
});

export async function getConnectionTarget(gameMode: string): Promise<ConnectionTarget> {
Expand Down
14 changes: 14 additions & 0 deletions javascript/asteroids-socketio-canvas/example.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[display]
title = "Asteroids"
demo_url = "https://asteroids.staging2.boatbumpers.io/"
overview_weight = 95

[meta]
engine = "JavaScript"
languages = ["TypeScript"]
platforms = ["HTML5"]
networking = "SocketIo"
rendering = "HTML5Canvas"
features = ["Matchmaker", "DynamicServers"]


Loading

0 comments on commit edd8506

Please sign in to comment.