Compare commits

...

3 Commits

@ -0,0 +1,8 @@
node_modules
client/dist
games/
server/.lake
**/.DS_Store
logs/
relay/prev_cpu_metric
test.ecosystem.config.cjs

@ -0,0 +1,29 @@
FROM node:23-bookworm
RUN apt update && apt upgrade -y
RUN apt install -y bubblewrap
WORKDIR /app
# Install elan
RUN curl -sSfL https://github.com/leanprover/elan/releases/download/v3.0.0/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz && \
./elan-init -y
ENV PATH="/root/.elan/bin:${PATH}"
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy project files
COPY . .
# Build the project
RUN npm run build
EXPOSE 8080
# Set the entrypoint
CMD ["npm", "run", "production"]

@ -1,3 +1,35 @@
# lean4game fork
Questo è un fork di **lean4game** con supporto per essere self-hostato con Docker.
## Deployment con Docker Compose
Dopo aver clonato questa repo, per prima cosa serve creare [un token di API per GitHub](https://github.com/settings/developers) per permettere a lean4game di importare da solo i vari "game". Possiamo mettere questo token ed il nostro nome utente in un file `.env` come segue
```
export LEAN4GAME_GITHUB_USER='...'
export LEAN4GAME_GITHUB_TOKEN='...'
```
poi per lanciare tutto con docker compose basta eseguire
```bash
$ source .env
$ docker compose up -d
```
Questo comando lancierà lean4game su `http://locahost:8080`.
### Aggiungere Giochi
Per scaricare nuovi giochi basta fare una chiamata al seguente url
- `https://{host}/import/trigger/{org}/{repo}`
Ad esempio per scaricare <https://github.com/leanprover-community/nng4> basta andare all'indirizzo `https://{host}/import/trigger/leanprover-community/nng4` per aggiungere _Natural Number Game_.
---
# Lean 4 Game
This is the source code for a Lean game platform hosted at [adam.math.hhu.de](https://adam.math.hhu.de).

2964
bun.lock

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
services:
lean4game:
build: .
privileged: true # needed to run bubblewrap inside docker
environment:
- LEAN4GAME_GITHUB_USER=${LEAN4GAME_GITHUB_USER}
- LEAN4GAME_GITHUB_TOKEN=${LEAN4GAME_GITHUB_TOKEN}
ports:
- "8080:8080"
volumes:
- games_data:/app/games
volumes:
games_data:
Loading…
Cancel
Save