mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
fix: deployment
+ include api-docs in nginx + include quests in docker compose + update README
This commit is contained in:
1 parent
9aa9367f9e
commit
d8f8605df9
5 files changed
+31
-42
No files matched your search
@@ -8,64 +8,47 @@
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
git clone https://github.com/lancatlin/linux-odyssey.git
|
||||
cd linux-odyssey
|
||||
yarn install
|
||||
```
|
||||
|
||||
## Create database
|
||||
## Developement
|
||||
|
||||
```
|
||||
docker compose pull
|
||||
docker compose up -d db
|
||||
```
|
||||
|
||||
## Server
|
||||
|
||||
Source: `server/`
|
||||
|
||||
```
|
||||
docker compose -f docker-compose.build.yml pull
|
||||
docker compose up -d
|
||||
# Open http://localhost:3000
|
||||
```
|
||||
|
||||
### Build images
|
||||
Run everything (frontend, backend, db, swagger, quests):
|
||||
|
||||
docker compose build
|
||||
docker compose push
|
||||
docker compose up -d
|
||||
|
||||
Game images:
|
||||
### Deployment
|
||||
|
||||
```
|
||||
docker compose -f docker-compose.build.yml build
|
||||
docker compose -f docker-compose.build.yml push
|
||||
```
|
||||
docker compose -f docker-compose.prod.yml build
|
||||
docker compose -f docker-compose.prod.yml push
|
||||
|
||||
## App
|
||||
# Server side
|
||||
docker compose -f docker-compose.prod.yml pull
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
|
||||
## Standalone App (without Docker)
|
||||
|
||||
Source: `app/`
|
||||
|
||||
```
|
||||
# Connect to dev server (https://odyssey.wancat.cc)
|
||||
yarn app
|
||||
|
||||
# Connect to localhost (http://localhost:3000)
|
||||
yarn app:local
|
||||
```
|
||||
|
||||
# Connect to anyhost
|
||||
API_ENDPOINT=http://example.com yarn app:local
|
||||
|
||||
## Swagger
|
||||
|
||||
```
|
||||
docker compose up -d swagger
|
||||
```
|
||||
|
||||
Open http://localhost:8080 to open Swagger
|
||||
|
||||
## CLI terminal client
|
||||
## CLI terminal client (Docker not required)
|
||||
|
||||
```
|
||||
yarn cli
|
||||
Usage: client [options] [command]
|
||||
|
||||
@@ -77,7 +60,6 @@ Options:
|
||||
|
||||
Commands:
|
||||
list List all sessions
|
||||
```
|
||||
|
||||
connet to recent session:
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ server {
|
||||
proxy_pass http://backend:3000;
|
||||
}
|
||||
|
||||
location /api-docs/ {
|
||||
proxy_pass http://backend:3000;
|
||||
}
|
||||
|
||||
location /socket.io/ {
|
||||
proxy_pass http://backend:3000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
version: '3'
|
||||
services:
|
||||
helloworld:
|
||||
image: lancatlin/linux-odyssey:helloworld
|
||||
build:
|
||||
context: .
|
||||
dockerfile: quests/helloworld/Dockerfile
|
||||
@@ -18,8 +18,6 @@ services:
|
||||
networks:
|
||||
- internal
|
||||
- players
|
||||
ports:
|
||||
- '3000:3000'
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
@@ -42,6 +40,12 @@ services:
|
||||
- MONGO_PASS=user-password
|
||||
- MONGO_DB=odyssey-test
|
||||
|
||||
helloworld:
|
||||
image: lancatlin/linux-odyssey:helloworld
|
||||
build:
|
||||
context: .
|
||||
dockerfile: quests/helloworld/Dockerfile
|
||||
|
||||
networks:
|
||||
internal:
|
||||
players:
|
||||
|
||||
@@ -47,6 +47,12 @@ services:
|
||||
environment:
|
||||
- SWAGGER_FILE=/tmp/swagger.yaml
|
||||
|
||||
helloworld:
|
||||
image: lancatlin/linux-odyssey:helloworld
|
||||
build:
|
||||
context: .
|
||||
dockerfile: quests/helloworld/Dockerfile
|
||||
|
||||
networks:
|
||||
internal:
|
||||
players:
|
||||
|
||||
Reference in new issue
Block a user