Browse Source

Docker all in one

develop
CareyWong 5 years ago
parent
commit
6ef0b8a73f
  1. 7
      .env.example
  2. 1
      .gitignore
  3. 12
      README.md
  4. 34
      docker-compose.yaml

7
.env.example

@ -0,0 +1,7 @@
SUBWEB_PORT=58080
SUBCONVERTER_PORT=25500
MYURLS_PORT=8002
MYURLS_DOMAIN=example.com
MYURLS_TTL=90

1
.gitignore

@ -5,6 +5,7 @@ node_modules
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local
.env
# Log files # Log files
npm-debug.log* npm-debug.log*

12
README.md

@ -14,6 +14,18 @@
## Update ## Update
- 20200324
- 现在你可以使用 docker-compose 启动包括前后端、短链接服务,服务端口及其他参数请自行在 .env 中配置。
```shell
git clone https://github.com/CareyWang/sub-web.git sub-web
cd sub-web
cp .env.example .env
docker-compose up -d
```
- 20200309 - 20200309
- 由于 bitly 免费账户月调用量限制,现在你可以放弃bitly,使用本地部署的短链接服务。参考 [MyUrls](https://github.com/CareyWang/MyUrls) 搭建。 - 由于 bitly 免费账户月调用量限制,现在你可以放弃bitly,使用本地部署的短链接服务。参考 [MyUrls](https://github.com/CareyWang/MyUrls) 搭建。

34
docker-compose.yaml

@ -0,0 +1,34 @@
version: "3"
services:
subweb:
build: .
container_name: subweb
restart: always
ports:
- "${SUBWEB_PORT}:80"
subconverter:
image: "tindy2013/subconverter:latest"
container_name: subconverter
restart: always
ports:
- "${SUBCONVERTER_PORT}:25500"
myurls:
image: "careywong/myurls:latest"
container_name: myurls
restart: always
env_file: .env
ports:
- "${MYURLS_PORT}:8002"
depends_on:
- myurls-redis
entrypoint: ["/app/myurls", "-domain", "${MYURLS_DOMAIN}", "-conn", myurls-redis:6379, "-ttl", "${MYURLS_TTL}"]
myurls-redis:
image: "redis:5"
container_name: myurls-redis
restart: always
expose:
- "6379"
Loading…
Cancel
Save