version: '3' services: nginx: container_name: v-nginx image: nginx:1.13 restart: always ports: - 80:80 - 443:443 volumes: - ./nginx/conf.d:/etc/nginx/conf.d depends_on: - app mysql: container_name: v-mysql image: mysql/mysql-server:5.7 environment: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_HOST: '%' ports: - "3306:3306" restart: always app: restart: always build: context: ./app dockerfile: ./Dockerfile image: jianboy/springboot-note:latest environment: JAVA_OPTS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y working_dir: /app volumes: - ./app:/app - ~/.m2:/root/.m2 ports: - 8080:8080 depends_on: - mysql - nginx command: mvn clean spring-boot:run -Dspring-boot.run.profiles=docker