0

I could connect to the mysql database from spring boot server first time. After I downed the container using 'docker-compose down -v' command I can no lonager make a connection to the server of spring boot and mysql database in docker network after the first time(every time I change container name is works). I want to make a connection between spring boot server and mysql

docker-compose.yml:

version: "3.8"

services:
  mysql:
    container_name: db12w
    image: mysql:5.7
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=reactlibrarydatabase
      - MYSQL_PORT=3306
    networks:
      - shared-network
    volumes:
      - mysqlvolume:/var/lib/mysql
      # - ./db/bookwise.sql:/docker-entrypoint-initdb.d/bookwise.sql

  # mysql-workbench:
  #   container_name: mysqlwbcontainer
  #   image: linuxserver/mysql-workbench:8.0.33
  #   restart: always
  #   environment:
  #     CUSTOM_USER: abc
  #     PASSWORD: root
  #     CUSTOM_PORT: 5050
  #   ports:
  #     - 5050:5050
  #   networks:
  #     - shared-network
  #   depends_on:
  #     - mysql
  #   # volumes:
  #   #   - mysql-workbench-volume:/var/lib/mysql
  
  # nginx:
  #   image: nginx
  #   # container_name: nginx_container
  #   restart: always
  #   volumes:
  #     - ./default.conf:/etc/nginx/conf.d/default.conf
  #     # - ./certs/localsslexample-key.pem:/etc/nginx/certs/devopsbyexample-key.pem
  #     # - ./certs/localsslexample.pem:/etc/nginx/certs/devopsbyexample.pem
  #   ports:
  #     - 80:80
  #     - 443:443
  #   networks:
  #     - shared-network
  #   depends_on:
  #     - server
  #     - client

  server:
    container_name: bookwise_server
    restart: unless-stopped
    image: bookwise-server-image:1.0.0
    build:
      context: Backend
      dockerfile: Dockerfile
    environment:
      - spring_datasource_driver-class-name=com.mysql.cj.jdbc.Driver
      - spring_datasource_url=jdbc:mysql://db12w:3306/reactlibrarydatabase
      - spring_datasource_username=root
      - spring_datasource_password=root
    ports:  #outside:inside(container) #8443
      - 8443:8443
    networks:
      - shared-network
    depends_on:
      - mysql

  client:
    container_name: bookwise_client
    restart: unless-stopped
    image: bookwise-client-image:1.0.0
    build:
      context: Frontend
      dockerfile: Dockerfile
    ports:  #outside:inside(container)
      - 3000:3000
    # environment:
      # - REACT_APP_API_URL=https://localhost/api
    # volumes:
    #   - ./certs/devopsbyexample-key.pem:/etc/nginx/certs/devopsbyexample-key.pem
    #   - ./certs/devopsbyexample.pem:/etc/nginx/certs/devopsbyexample.pem
    networks:
      - shared-network
    depends_on:
      - server
volumes:
  mysqlvolume:
  # mysql-workbench-volume:
networks:
  shared-network:
    driver: bridge

This is the log in command prompt when I launch 'docker-compose up' first time the code works fine but the second time it theowing the error. Both the output are in the below log one after the other

C:\profitional\react\LibraryManagmentSystem>docker-compose up
[+] Running 3/3
 ✔ Container db12w            Recreated                                                                                                                                                                                                  0.1s 
 ✔ Container bookwise_server  Recreated                                                                                                                                                                                                  0.2s 
 ✔ Container bookwise_client  Recreated                                                                                                                                                                                                  0.1s 
Attaching to bookwise_client, bookwise_server, db12w
db12w            | 2023-07-15 22:10:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
db12w            | 2023-07-15 22:10:37+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db12w            | 2023-07-15 22:10:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
db12w            | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
db12w            | 2023-07-15T22:10:37.888464Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db12w            | 2023-07-15T22:10:37.890408Z 0 [Note] mysqld (mysqld 5.7.42) starting as process 1 ...
db12w            | 2023-07-15T22:10:37.895488Z 0 [Note] InnoDB: PUNCH HOLE support available
db12w            | 2023-07-15T22:10:37.895550Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db12w            | 2023-07-15T22:10:37.895559Z 0 [Note] InnoDB: Uses event mutexes
db12w            | 2023-07-15T22:10:37.895563Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db12w            | 2023-07-15T22:10:37.895567Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
db12w            | 2023-07-15T22:10:37.895571Z 0 [Note] InnoDB: Using Linux native AIO
db12w            | 2023-07-15T22:10:37.896119Z 0 [Note] InnoDB: Number of pools: 1
db12w            | 2023-07-15T22:10:37.896373Z 0 [Note] InnoDB: Using CPU crc32 instructions
db12w            | 2023-07-15T22:10:37.905985Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db12w            | 2023-07-15T22:10:37.921187Z 0 [Note] InnoDB: Completed initialization of buffer pool
db12w            | 2023-07-15T22:10:37.925524Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db12w            | 2023-07-15T22:10:37.938253Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db12w            | 2023-07-15T22:10:37.940360Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12218043
db12w            | 2023-07-15T22:10:37.940449Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12218052
db12w            | 2023-07-15T22:10:37.940461Z 0 [Note] InnoDB: Database was not shutdown normally!
db12w            | 2023-07-15T22:10:37.940468Z 0 [Note] InnoDB: Starting crash recovery.
db12w            | 2023-07-15T22:10:38.052807Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db12w            | 2023-07-15T22:10:38.052865Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db12w            | 2023-07-15T22:10:38.052920Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db12w            | 2023-07-15T22:10:38.073676Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db12w            | 2023-07-15T22:10:38.075104Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db12w            | 2023-07-15T22:10:38.075168Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db12w            | 2023-07-15T22:10:38.077215Z 0 [Note] InnoDB: 5.7.42 started; log sequence number 12218052
db12w            | 2023-07-15T22:10:38.078418Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db12w            | 2023-07-15T22:10:38.079016Z 0 [Note] Plugin 'FEDERATED' is disabled.
db12w            | 2023-07-15T22:10:38.083454Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230715 22:10:38
db12w            | 2023-07-15T22:10:38.089920Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db12w            | 2023-07-15T22:10:38.090087Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db12w            | 2023-07-15T22:10:38.090134Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
db12w            | 2023-07-15T22:10:38.090170Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
db12w            | 2023-07-15T22:10:38.092800Z 0 [Warning] CA certificate ca.pem is self signed.
db12w            | 2023-07-15T22:10:38.092872Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db12w            | 2023-07-15T22:10:38.093323Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db12w            | 2023-07-15T22:10:38.093378Z 0 [Note] IPv6 is available.
db12w            | 2023-07-15T22:10:38.093397Z 0 [Note]   - '::' resolves to '::';
db12w            | 2023-07-15T22:10:38.093419Z 0 [Note] Server socket created on IP: '::'.
db12w            | 2023-07-15T22:10:38.098890Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db12w            | 2023-07-15T22:10:38.113072Z 0 [Note] Event Scheduler: Loaded 0 events
db12w            | 2023-07-15T22:10:38.113560Z 0 [Note] mysqld: ready for connections.
db12w            | Version: '5.7.42'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
bookwise_client  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
bookwise_client  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
bookwise_client  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
bookwise_client  | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
bookwise_client  | 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
bookwise_client  | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
bookwise_client  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
bookwise_client  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
bookwise_client  | /docker-entrypoint.sh: Configuration complete; ready for start up
bookwise_server  | 
bookwise_server  |   .   ____          _            __ _ _
bookwise_server  |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
bookwise_server  | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
bookwise_server  |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
bookwise_server  |   '  |____| .__|_| |_|_| |_\__, | / / / /
bookwise_server  |  =========|_|==============|___/=/_/_/_/
bookwise_server  |  :: Spring Boot ::               (v2.7.11)
bookwise_server  |
bookwise_server  | 2023-07-15 22:10:39.204  INFO 1 --- [           main] c.l.l.s.SpringBootLibraryApplication     : Starting SpringBootLibraryApplication v0.0.1-SNAPSHOT using Java 17.0.2 on bcfb65cd1390 with PID 1 (/app/app.jar started by root in /app)
bookwise_server  | 2023-07-15 22:10:39.208  INFO 1 --- [           main] c.l.l.s.SpringBootLibraryApplication     : No active profile set, falling back to 1 default profile: "default"
bookwise_server  | 2023-07-15 22:10:40.252  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
bookwise_server  | 2023-07-15 22:10:40.347  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 81 ms. Found 6 JPA repository interfaces.
bookwise_server  | 2023-07-15 22:10:41.366  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8443 (https)
bookwise_server  | 2023-07-15 22:10:41.382  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
bookwise_server  | 2023-07-15 22:10:41.383  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.74]
bookwise_server  | 2023-07-15 22:10:41.470  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
bookwise_server  | 2023-07-15 22:10:41.470  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2162 ms
bookwise_server  | 2023-07-15 22:10:41.834  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
bookwise_server  | 2023-07-15 22:10:42.306  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
bookwise_server  | 2023-07-15 22:10:42.367  INFO 1 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
bookwise_server  | 2023-07-15 22:10:42.434  INFO 1 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.15.Final
bookwise_server  | 2023-07-15 22:10:42.663  INFO 1 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
bookwise_server  | 2023-07-15 22:10:42.808  INFO 1 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
bookwise_server  | 2023-07-15 22:10:43.506  INFO 1 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
bookwise_server  | 2023-07-15 22:10:43.519  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
bookwise_server  | 2023-07-15 22:10:45.701  WARN 1 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
bookwise_server  | 2023-07-15 22:10:46.425  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@1ac6dd3d, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@562919fe, org.springframework.security.web.context.SecurityContextPersistenceFilter@36f7d7b, org.springframework.security.web.header.HeaderWriterFilter@1e79d43, org.springframework.web.filter.CorsFilter@794f11cd, org.springframework.security.web.authentication.logout.LogoutFilter@2007435e, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter@64ae105d, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter@53aa2fc9, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@7c281eb8, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@715f45c6, org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationFilter@67b355c8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6361b799, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1b9d9a2b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5d5c41e5, org.springframework.security.web.session.SessionManagementFilter@4c0e426a, org.springframework.security.web.access.ExceptionTranslationFilter@467233e4, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@294aba23]
bookwise_server  | 2023-07-15 22:10:47.408  INFO 1 --- [           main] o.a.t.util.net.NioEndpoint.certificate   : Connector [https-jsse-nio-8443], TLS virtual host [_default_], certificate type [UNDEFINED] configured from [jar:file:/app/app.jar!/BOOT-INF/classes!/luv2code-keystore.p12] using alias [luv2code] and with trust store [null]
bookwise_server  | 2023-07-15 22:10:47.431  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8443 (https) with context path ''
bookwise_server  | 2023-07-15 22:10:47.446  INFO 1 --- [           main] c.l.l.s.SpringBootLibraryApplication     : Started SpringBootLibraryApplication in 8.803 seconds (JVM running for 9.56)
Gracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
[+] Running 1/2
 ✔ Container bookwise_client  Stopped                                                                                                                                                                                                    0.5s 
 - Container bookwise_server  Stopping                                                                                                                                                                                                   0.2s 
[+] Running 3/3
 ✔ Container bookwise_client  Stopped                                                                                                                                                                                                    0.5s 
 ✔ Container bookwise_server  Stopped                                                                                                                                                                                                    0.6s 
 ✔ Container db12w            Stopped                                                                                                                                                                                                    0.1s 
canceled

C:\profitional\react\LibraryManagmentSystem>docker-compose down -v
[+] Running 5/5
 ✔ Container bookwise_client                      Removed                                                                                                                                                                                0.0s 
 ✔ Container bookwise_server                      Removed                                                                                                                                                                                0.0s 
 ✔ Container db12w                                Removed                                                                                                                                                                                0.0s 
 ✔ Volume librarymanagmentsystem_mysqlvolume      Removed                                                                                                                                                                                0.1s 
 ✔ Network librarymanagmentsystem_shared-network  Removed                                                                                                                                                                                0.3s 

C:\profitional\react\LibraryManagmentSystem>docker-compose up      
[+] Running 5/4
 ✔ Network librarymanagmentsystem_shared-network  Created                                                                                                                                                                                0.0s 
 ✔ Volume "librarymanagmentsystem_mysqlvolume"    Created                                                                                                                                                                                0.0s 
 ✔ Container db12w                                Created                                                                                                                                                                                0.1s 
 ✔ Container bookwise_server                      Created                                                                                                                                                                                0.1s 
 ✔ Container bookwise_client                      Created                                                                                                                                                                                0.1s 
Attaching to bookwise_client, bookwise_server, db12w
db12w            | 2023-07-15 22:11:12+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
db12w            | 2023-07-15 22:11:12+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db12w            | 2023-07-15 22:11:12+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
db12w            | 2023-07-15 22:11:12+00:00 [Note] [Entrypoint]: Initializing database files
db12w            | 2023-07-15T22:11:12.657616Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db12w            | 2023-07-15T22:11:12.816916Z 0 [Warning] InnoDB: New log files created, LSN=45790
db12w            | 2023-07-15T22:11:12.854744Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
db12w            | 2023-07-15T22:11:12.915335Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 828aaacf-235c-11ee-ae02-0242ac1b0002.
db12w            | 2023-07-15T22:11:12.918775Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
db12w            | 2023-07-15T22:11:13.273991Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
db12w            | 2023-07-15T22:11:13.274046Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
db12w            | 2023-07-15T22:11:13.274805Z 0 [Warning] CA certificate ca.pem is self signed.
db12w            | 2023-07-15T22:11:13.310035Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
bookwise_client  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
bookwise_client  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
bookwise_client  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
bookwise_client  | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
bookwise_client  | 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
bookwise_client  | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
bookwise_client  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
bookwise_client  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
bookwise_client  | /docker-entrypoint.sh: Configuration complete; ready for start up
bookwise_server  | 
bookwise_server  |   .   ____          _            __ _ _
bookwise_server  |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
bookwise_server  | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
bookwise_server  |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
bookwise_server  |   '  |____| .__|_| |_|_| |_\__, | / / / /
bookwise_server  |  =========|_|==============|___/=/_/_/_/
bookwise_server  |  :: Spring Boot ::               (v2.7.11)
bookwise_server  |
bookwise_server  | 2023-07-15 22:11:14.291  INFO 1 --- [           main] c.l.l.s.SpringBootLibraryApplication     : Starting SpringBootLibraryApplication v0.0.1-SNAPSHOT using Java 17.0.2 on df9c0c2f70c9 with PID 1 (/app/app.jar started by root in /app)
bookwise_server  | 2023-07-15 22:11:14.295  INFO 1 --- [           main] c.l.l.s.SpringBootLibraryApplication     : No active profile set, falling back to 1 default profile: "default"
bookwise_server  | 2023-07-15 22:11:15.317  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
bookwise_server  | 2023-07-15 22:11:15.403  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 75 ms. Found 6 JPA repository interfaces.
bookwise_server  | 2023-07-15 22:11:16.401  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8443 (https)
bookwise_server  | 2023-07-15 22:11:16.414  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
bookwise_server  | 2023-07-15 22:11:16.415  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.74]
bookwise_server  | 2023-07-15 22:11:16.528  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
bookwise_server  | 2023-07-15 22:11:16.528  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2126 ms
db12w            | 2023-07-15 22:11:16+00:00 [Note] [Entrypoint]: Database files initialized
db12w            | 2023-07-15 22:11:16+00:00 [Note] [Entrypoint]: Starting temporary server
db12w            | 2023-07-15 22:11:16+00:00 [Note] [Entrypoint]: Waiting for server startup
db12w            | 2023-07-15T22:11:16.867643Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db12w            | 2023-07-15T22:11:16.870005Z 0 [Note] mysqld (mysqld 5.7.42) starting as process 125 ...
db12w            | 2023-07-15T22:11:16.875441Z 0 [Note] InnoDB: PUNCH HOLE support available
db12w            | 2023-07-15T22:11:16.875526Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db12w            | 2023-07-15T22:11:16.875536Z 0 [Note] InnoDB: Uses event mutexes
db12w            | 2023-07-15T22:11:16.875541Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db12w            | 2023-07-15T22:11:16.875545Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
db12w            | 2023-07-15T22:11:16.875549Z 0 [Note] InnoDB: Using Linux native AIO
db12w            | 2023-07-15T22:11:16.876002Z 0 [Note] InnoDB: Number of pools: 1
db12w            | 2023-07-15T22:11:16.876222Z 0 [Note] InnoDB: Using CPU crc32 instructions
db12w            | 2023-07-15T22:11:16.879169Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db12w            | 2023-07-15T22:11:16.900360Z 0 [Note] InnoDB: Completed initialization of buffer pool
db12w            | 2023-07-15T22:11:16.904268Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db12w            | 2023-07-15T22:11:16.917087Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db12w            | 2023-07-15T22:11:16.939074Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db12w            | 2023-07-15T22:11:16.939246Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
bookwise_server  | 2023-07-15 22:11:16.958  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
db12w            | 2023-07-15T22:11:16.966648Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db12w            | 2023-07-15T22:11:16.968359Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db12w            | 2023-07-15T22:11:16.968435Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
  • The important thing in this output is that there is database output after the application tries to start up. Initializing the database can take some time, and if you're seeing this symptom (just `docker-compose up -d` a second time with no changes should bring things up) it means you're not correctly waiting for the database. See [Docker Compose wait for container X before starting Y](https://stackoverflow.com/questions/31746182/docker-compose-wait-for-container-x-before-starting-y) for some suggestions. – David Maze Jul 16 '23 at 10:16

0 Answers0