55 lines
893 B
Markdown
55 lines
893 B
Markdown
# Deploy CA Lab Studio
|
|||
|
|
|
||
|
|
Deploy `glitch_voxel_automata_lab`, not `glitch_voxel_automata`.
|
||
|
|
|
||
|
|
This app is the CA Lab Studio service:
|
||
|
|
|
||
|
|
- Express API at `/api/ca/*`
|
||
|
|
- React admin app at `/admin`
|
||
|
|
- React viewer/recorder routes at `/view/*`
|
||
|
|
- Postgres database via `DATABASE_URL`
|
||
|
|
|
||
|
|
## Build
|
||
|
|
|
||
|
|
```bash
|
||
|
|
nvm use 20
|
||
|
|
npm --prefix backend ci
|
||
|
|
npm run build
|
||
|
|
```
|
||
|
|
|
||
|
|
The build creates:
|
||
|
|
|
||
|
|
```txt
|
||
|
|
backend/dist/server.js
|
||
|
|
backend/public/admin/index.html
|
||
|
|
backend/public/admin/assets/*
|
||
|
|
```
|
||
|
|
|
||
|
|
## Start
|
||
|
|
|
||
|
|
```bash
|
||
|
|
DATABASE_URL=postgres://... PORT=3100 npm start
|
||
|
|
```
|
||
|
|
|
||
|
|
Run migrations before starting or during release:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
DATABASE_URL=postgres://... npm run migrate
|
||
|
|
```
|
||
|
|
|
||
|
|
## Docker
|
||
|
|
|
||
|
|
```bash
|
||
|
|
docker build -t ca-lab-studio .
|
||
|
|
docker run --rm -p 3100:3100 \
|
||
|
|
-e DATABASE_URL=postgres://... \
|
||
|
|
ca-lab-studio
|
||
|
|
```
|
||
|
|
|
||
|
|
The container serves the app at:
|
||
|
|
|
||
|
|
```txt
|
||
|
|
http://localhost:3100/admin
|
||
|
|
http://localhost:3100/view/decks/:deckId
|
||
|
|
```
|