diff --git a/docker/Dockerfile b/Dockerfile similarity index 50% rename from docker/Dockerfile rename to Dockerfile index 80b7b27..7c4d9d6 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -6,12 +6,9 @@ ENV PARAMS="" # 设置工作目录 WORKDIR /build # 将jar包复制到容器中 -ADD ./austin-web-0.0.1-SNAPSHOT.jar ./austin.jar +ADD ./austin-web/target/austin-web-0.0.1-SNAPSHOT.jar ./austin.jar # 暴露8080端口 EXPOSE 8080 # 运行jar包 ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS austin.jar $PARAMS"] - -# docker build -t austin:0.1 . -# docker run -e PARAMS="--austin.database.ip= --austin.database.port=3306 --austin.redis.ip= --austin.mq.pipeline=eventbus " -p 8080:8080 --name austin:0.1 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5d666aa --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,41 @@ +version: '3' +services: + austin-mysql: + environment: + TZ: Asia/Shanghai + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MYSQL_ROOT_HOST: '%' + MYSQL_ROOT_PASSWORD: "root123_A" + restart: always + container_name: austin-mysql + image: mysql:5.7 + hostname: austin-mysql + command: --init-file /docker-entrypoint-initdb.d/init.sql + volumes: + - ./sql/austin.sql:/docker-entrypoint-initdb.d/init.sql + ports: + - 23306:3306 + networks: + - app + austin-redis: + image: redis:3.2 + ports: + - 16379:6379 + restart: always + container_name: austin-redis + networks: + - app + austin: + build: + context: ./ + ports: + - 8080:8080 + restart: always + container_name: austin + depends_on: + - austin-redis + - austin-mysql + networks: + - app +networks: + app: