-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from Statrue/dev
feat: add Dev Container support
- Loading branch information
Showing
6 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Application | ||
APP_ENV=prod | ||
APP_HOST=0.0.0.0 | ||
APP_PORT=3000 | ||
APP_SECRET_KEY=devkey | ||
APP_HTTP_PROXY= | ||
APP_ENABLE_CORS=1 | ||
|
||
# FFmpeg | ||
FFMPEG_PATH=ffmpeg | ||
FFPROBE_PATH=ffprobe | ||
|
||
# Database | ||
DB_HOST=mysql | ||
DB_PORT=3306 | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
DB_DATABASE=minaplay | ||
|
||
# Redis | ||
REDIS_HOST=redis | ||
REDIS_PORT=6379 | ||
REDIS_DB=0 | ||
REDIS_PASSWORD= | ||
|
||
# Aria2 | ||
ARIA2_RPC_HOST=aria2 | ||
ARIA2_RPC_PORT=6800 | ||
ARIA2_RPC_PATH=/jsonrpc | ||
ARIA2_RPC_SECRET=dev | ||
ARIA2_AUTO_UPDATE_TRACKER=1 | ||
ARIA2_TRACKER_LIST_URL="https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_best.txt" | ||
|
||
# Mediasoup | ||
MS_ANNOUNCED_IP=127.0.0.1 | ||
MS_RTC_MIN_PORT=12000 | ||
MS_RTC_MAX_PORT=12999 | ||
MS_WORKERS_NUM=4 | ||
MS_AUDIO_CLOCK_RATE=48000 | ||
MS_AUDIO_CHANNELS=2 | ||
MS_AUDIO_MAX_INCOME_BITRATE=1500000 | ||
|
||
# Live Stream | ||
STREAM_RTMP_PORT=1935 | ||
STREAM_HTTP_PORT=3001 | ||
STREAM_CHUNK_SIZE=60000 | ||
STREAM_PUBLISH_KEY= | ||
|
||
# Notifications | ||
# WS | ||
NOTIFY_WS=1 | ||
|
||
NOTIFY_EMAIL=0 | ||
NOTIFY_EMAIL_SMTP_HOST=mail.example.com | ||
NOTIFY_EMAIL_SMTP_PORT=25 | ||
NOTIFY_EMAIL_SMTP_SECURE=0 | ||
NOTIFY_EMAIL_SMTP_USER=no-reply@example.com | ||
NOTIFY_EMAIL_SMTP_PASSWORD=password | ||
NOTIFY_EMAIL_ORIGIN="MinaPlay <minaplay@example.com>" | ||
NOTIFY_EMAIL_SUBJECT="MinaPlay Email Notification" | ||
|
||
# ServerChan | ||
NOTIFY_SERVER_CHAN=0 | ||
|
||
# Telegram | ||
NOTIFY_TELEGRAM=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_API_HOST="http://localhost:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node | ||
{ | ||
"name": "Minaplay_DevContainer", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [5173, 3000, 3001, 1935] | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "sh ./.devcontainer/setup.sh", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
services: | ||
app: | ||
image: mcr.microsoft.com/vscode/devcontainers/typescript-node:20-bookworm | ||
container_name: basic_env | ||
environment: | ||
- DB_HOST=mysql | ||
- REDIS_HOST=redis | ||
- MS_ANNOUNCED_IP=127.0.0.1 | ||
networks: | ||
- minaplay-network | ||
ports: | ||
- "5173:5173" | ||
- "3000:3000" | ||
- "3001:3001" | ||
- "1935:1935" | ||
volumes: | ||
- ../..:/workspaces:cached | ||
depends_on: | ||
- mysql | ||
- redis | ||
- aria2 | ||
command: sleep infinity | ||
|
||
mysql: | ||
image: mysql:8 | ||
container_name: mysql | ||
environment: | ||
- TZ=Asia/Shanghai | ||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes | ||
- MYSQL_DATABASE=minaplay | ||
networks: | ||
- minaplay-network | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- mysql-data:/var/lib/mysql | ||
|
||
redis: | ||
image: redis:latest | ||
container_name: redis | ||
networks: | ||
- minaplay-network | ||
ports: | ||
- "6379:6379" | ||
|
||
aria2: | ||
image: p3terx/aria2-pro:latest | ||
container_name: aria2 | ||
networks: | ||
- minaplay-network | ||
ports: | ||
- "6800:6800" | ||
environment: | ||
- RPC_SECRET=dev | ||
|
||
volumes: | ||
mysql-data: | ||
|
||
networks: | ||
minaplay-network: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
pwd | ||
##################### | ||
# web project setup # | ||
##################### | ||
# Navigate to the web directory | ||
cd ./packages/web | ||
# setup | ||
yarn install | ||
cp ../../.devcontainer/.env.dev.web .env | ||
|
||
######################## | ||
# server project setup # | ||
######################## | ||
# Navigate to the server directory | ||
cd ../server | ||
# setup | ||
yarn | ||
yarn add sharp --ignore-engines | ||
yarn global add @nestjs/cli | ||
cp ../../.devcontainer/.env.dev.server .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters