我的 docker-compose 配置存在无法确定的问题:redis 无法启动。
我的 docker-compose.yml:
web:
build: ./web
links:
- db
- redis
ports:
- "8080:8080"
db:
image: mysql
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: bignibou_dev
redis:
build: ./redis
ports:
- "63790:6379"
我的./web/Dockerfile:
FROM java:8
ADD ./bignibou-server-1.0.jar /app/bignibou-server-1.0.jar
ADD ./spring-cloud.properties /app/spring-cloud.properties
ENV SPRING_CLOUD_PROPERTIESFILE=/app/spring-cloud.properties
ENV SPRING_PROFILES_ACTIVE=cloud
ENV SPRING_CLOUD_APP_NAME=bignibou
ENV CLEARDB_DATABASE_URL=mysql://root:root@localhost:3307/bignibou_dev
ENV REDISCLOUD_URL=redis://dummy:dummy@localhost:63790
ENV DYNO=dummy
EXPOSE 8080
ENTRYPOINT [ "java", "-jar", "/app/bignibou-server-1.0.jar" ]
我的./redis/Dockerfile:
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
EXPOSE 6379
ENTRYPOINT [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
当我运行时sudo docker-compose up
,尽管mysql/db正常启动,但 Docker 并未启动redis。
有人可以帮忙吗?