docker-compose.yaml 913 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. version: '3'
  2. services:
  3. nginx:
  4. container_name: v-nginx
  5. image: nginx:1.13
  6. restart: always
  7. ports:
  8. - 80:80
  9. - 443:443
  10. volumes:
  11. - ./nginx/conf.d:/etc/nginx/conf.d
  12. depends_on:
  13. - app
  14. mysql:
  15. container_name: v-mysql
  16. image: mysql/mysql-server:5.7
  17. environment:
  18. MYSQL_DATABASE: test
  19. MYSQL_ROOT_PASSWORD: root
  20. MYSQL_ROOT_HOST: '%'
  21. ports:
  22. - "3306:3306"
  23. restart: always
  24. app:
  25. restart: always
  26. build:
  27. context: ./app
  28. dockerfile: ./Dockerfile
  29. image: jianboy/springboot-note:latest
  30. environment:
  31. JAVA_OPTS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y
  32. working_dir: /app
  33. volumes:
  34. - ./app:/app
  35. - ~/.m2:/root/.m2
  36. ports:
  37. - 8080:8080
  38. depends_on:
  39. - mysql
  40. - nginx
  41. command: mvn clean spring-boot:run -Dspring-boot.run.profiles=docker