docker与反向代理篇

  • 没有域名!
    • 没有域名真的寸步难行……很多container默认在根目录/下工作,一旦redirect出来不带相对路径就寄了,所以还是老老实实的在内网开端口吧
    • 考虑使用cloudflare tunnel

homepage

  • docker container不显示widget状态(链接
    • 首先,docker要能通过TCP提供docker本身的状态(比如这样)。或者通过一个container反向代理只在docker内网里提供信息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
dockerproxy:
image: ghcr.io/tecnativa/docker-socket-proxy:latest
container_name: dockerproxy
environment:
- CONTAINERS=1 # Allow access to viewing containers
- SERVICES=1 # Allow access to viewing services (necessary when using Docker Swarm)
- TASKS=1 # Allow access to viewing tasks (necessary when using Docker Swarm)
- POST=0 # Disallow any POST operations (effectively read-only)
ports:
- 127.0.0.1:2375:2375
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro # Mounted as read-only
restart: unless-stopped

homepage:
image: ghcr.io/gethomepage/homepage:latest
container_name: homepage
volumes:
- /path/to/config:/app/config
ports:
- 3000:3000
restart: unless-stopped

然后在docker.yaml文件里通过container name访问:

1
2
3
my-docker:
host: dockerproxy
port: 2375

数据库篇

  • mathesar不能链接到postgres
    • 似乎要从docker内网连接:localhost:5432是不会连上的,但是postgres:5432(service名为postgres)是可以的!