fix: deployment

+ include api-docs in nginx
+ include quests in docker compose
+ update README
This commit is contained in:
wancat committed 2023-08-22 12:11:58 +08:00
1 parent 9aa9367f9e
commit d8f8605df9
5 files changed
+31 -42

No files matched your search

+15 -33
View File
@@ -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:
+4
View File
@@ -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;
-7
View File
@@ -1,7 +0,0 @@
version: '3'
services:
helloworld:
image: lancatlin/linux-odyssey:helloworld
build:
context: .
dockerfile: quests/helloworld/Dockerfile
+6 -2
View File
@@ -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:
+6
View File
@@ -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: