|
| 1 | +<div align="center"> English | <a href="./README.md">简体中文</a> </div> |
| 2 | + |
| 3 | +# docker |
| 4 | + |
| 5 | +docker configuration repository |
| 6 | + |
| 7 | +## Deployment |
| 8 | + |
| 9 | +### 1. Initialization |
| 10 | + |
| 11 | +```sh |
| 12 | +mkdir -p /home/docker-compose |
| 13 | +mkdir /data |
| 14 | +git clone https://github.com/TranscodeGroup/docker.git /home/docker |
| 15 | +``` |
| 16 | + |
| 17 | +### 2. Configure `compose.yaml` |
| 18 | + |
| 19 | +Create `/home/docker-compose/compose.yaml` file, refer to the following example: |
| 20 | + |
| 21 | +**Single machine separate deployment**: |
| 22 | + |
| 23 | +- [bus-http](./examples/bus-http/compose.yaml): Bus http single machine deployment |
| 24 | +- [bus-https](./examples/bus-https/compose.yaml): Bus https single machine deployment |
| 25 | +- [track-http](./examples/track-http/compose.yaml): Tracker V2 http single machine deployment |
| 26 | +- [track-https](./examples/track-https/compose.yaml): Tracker V2 https single machine deployment |
| 27 | + |
| 28 | +**Distributed deployment**: |
| 29 | + |
| 30 | +- [video-storage](./examples/video-storage/compose.yaml): RTP storage |
| 31 | +- [video-stream](./examples/video-stream/compose.yaml): RTP video |
| 32 | + |
| 33 | +### 3. Configure `.env` |
| 34 | + |
| 35 | +Create `/home/docker-compose/.env` file, refer to [.env.default](./.env.default) to override the configuration items that need to be changed. |
| 36 | + |
| 37 | +Execute the following command in `/home/docker-compose` to verify whether all required values used have been set: |
| 38 | + |
| 39 | +```sh |
| 40 | +docker compose config |
| 41 | +``` |
| 42 | + |
| 43 | +After passing the verification, execute the following command to export the compose configuration to a file, so as to compare the differences after updating the compose file: |
| 44 | + |
| 45 | +```sh |
| 46 | +docker compose config > compose-stack.yaml |
| 47 | +``` |
| 48 | + |
| 49 | +### 4. Configure Frontend |
| 50 | + |
| 51 | +Frontend override directory, used to place project-specific frontend configuration files such as `_app.config.js`: |
| 52 | + |
| 53 | +- `/home/docker-compose/bus-override`: bus frontend override directory |
| 54 | +- `/home/docker-compose/track-override`: track frontend override directory |
| 55 | + |
| 56 | +**Note**: After modifying the configuration, you need to execute `docker compose up` for the file to be overwritten to `/data/nginx/html/`. Because it uses the overwrite method, it is not recommended to directly modify the files in `/data/nginx/html/`. |
| 57 | + |
| 58 | +### 5. Other optional configurations |
| 59 | + |
| 60 | +- [jtt808 video conversion tool](./jtt808/README.md) |
| 61 | +- [Manually download frontend](./scripts/README.md) |
| 62 | + |
| 63 | +### 6. Start |
| 64 | + |
| 65 | +Execute the following command in `/home/docker-compose` to start docker: |
| 66 | + |
| 67 | +```sh |
| 68 | +docker compose up |
| 69 | +``` |
| 70 | + |
| 71 | +### 7. Manage docker-compose directory with git |
| 72 | + |
| 73 | +Execute the following commands in `/home/docker-compose` |
| 74 | + |
| 75 | +```sh |
| 76 | +# Switch to the directory |
| 77 | +cd /home/docker-compose |
| 78 | + |
| 79 | +# After modifying the configuration each time, remember to back up the configuration to compare the actual impact difference |
| 80 | +docker compose config > compose-stack.yaml |
| 81 | + |
| 82 | +# Configure GIT account |
| 83 | +git config --global user.name "tg" |
| 84 | +git config --global user.email tg@gmail.com |
| 85 | + |
| 86 | +# Initialize GIT |
| 87 | +git init |
| 88 | +# Add to staging area |
| 89 | +git add -A |
| 90 | +# Commit local warehouse |
| 91 | +git commit -m "Initial commit" |
| 92 | +``` |
| 93 | + |
| 94 | +## Precautions |
| 95 | + |
| 96 | +### Version management, while iterating the version, remember to synchronize the scripts under mysql |
| 97 | + |
| 98 | +```sh |
| 99 | +# bus frontend |
| 100 | +BUS_WEB_VERSION=xxx |
| 101 | +# bus backend |
| 102 | +BUS_GATEWAY_VERSION=xxx |
| 103 | +#... |
| 104 | +``` |
0 commit comments