前言
今天做服务迁移,在新系统上构建docker镜像老是失败,开始以为是pip源的问题。替换了所有的源都超时。更换网络模式host后解决。
version: "3"
networks:
snet:
services:
backend:
build:
context: .
dockerfile: ./docker/Dockerfile
network: host
volumes:
- ./backend:/myapp
- ./frontend:/frontend
- /var/log/django/:/data/log/django
environment:
- "SET_CONTAINER_TIMEZONE=true"
- "TZ=Asia/Shanghai"
#command: sh /myapp/run.sh
command: sh /myapp/run-test.sh
restart: unless-stopped
extra_hosts:
- "mysqlserver:172.16.2.155"
#- "mysqlserver:172.16.4.10"
ports:
- "8013:8013"
networks:
- snet
评论 (0)