部署
公网部署
部署到公网环境,需要设置变量POSTER_URI_PREFIX
,把127.0.0.1
替换成服务器的IP
即可
注意,
POSTER_URI_PREFIX=http://127.0.0.1:5000/
后不要带#号。
bash
docker run -it \
-e POSTER_URI_PREFIX=http://127.0.0.1:5000/ \
--name fastposter \
-p 5000:5000 fastposter/fastposter
docker run -it \
-e POSTER_URI_PREFIX=http://127.0.0.1:5000/ \
--name fastposter \
-p 5000:5000 fastposter/fastposter
yaml
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
ports:
- 5000:5000
environment:
POSTER_URI_PREFIX: http://127.0.0.1:5000/
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
ports:
- 5000:5000
environment:
POSTER_URI_PREFIX: http://127.0.0.1:5000/
凭证
自定义凭证,需要设置环境变量TOKEN
bash
docker run -it \
-e TOKEN=ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv \
--name fastposter \
-p 5000:5000 fastposter/fastposter
docker run -it \
-e TOKEN=ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv \
--name fastposter \
-p 5000:5000 fastposter/fastposter
yaml
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
restart: on-failure
ports:
- 5000:5000
environment:
TOKEN: ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
restart: on-failure
ports:
- 5000:5000
environment:
TOKEN: ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv
数据持久
持久化数据和图片资源,需要挂载目录-v $PWD/data:/app/data
bash
docker run -it \
-v $PWD/data:/app/data \
--name fastposter \
-p 5000:5000 fastposter/fastposter
docker run -it \
-v $PWD/data:/app/data \
--name fastposter \
-p 5000:5000 fastposter/fastposter
yaml
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
ports:
- 5000:5000
volumes:
- ./data:/app/data
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
ports:
- 5000:5000
volumes:
- ./data:/app/data
完整配置
yaml
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
restart: on-failure
ports:
- 5000:5000
volumes:
- ./data:/app/data
environment:
TZ: Asia/Shanghai
TOKEN: ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv
POSTER_URI_PREFIX: http://127.0.0.1:5000/
networks:
default:
name: 'fastposter-net'
version: '3'
services:
fastposter:
container_name: fastposter
image: fastposter/fastposter
restart: on-failure
ports:
- 5000:5000
volumes:
- ./data:/app/data
environment:
TZ: Asia/Shanghai
TOKEN: ApfrIzxCoK1DwNZOEJCwlrnv6QZ0PCdv
POSTER_URI_PREFIX: http://127.0.0.1:5000/
networks:
default:
name: 'fastposter-net'