Docker-compose build issues
2025-02-242 turns20,248 charsgpt-4o
Summary
The user encountered a warning about the obsolete 'version' attribute in their docker-compose.yml file while attempting to build and run containers.
Messages
stant % docker-compose up --build
WARN[0000] /Users/danielkliewer/ai_research_assistant/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] Running 7/7
✔ neo4j Pulled 50.2s
✔ 4f4fb700ef54 Already exists 0.1s
✔ 5e38e4dfe0d7 Download complete 43.6s
✔ dae917b13b5d Download complete 37.8s
✔ dd26f867f102 Download complete 0.5s
✔ ef2fb7c49f69 Download complete 14.8s
✔ beb5407fc875 Download complete 0.2s
[+] Running 0/0
[+] Running 0/1end Building 0.1s
[+] Running 0/1.6s (9/11) docker:desktop-linux
[+] Building 49.8s (9/11) docker:desktop-linux
[+] Running 0/1.9s (9/11) docker:desktop-linux
[+] Building 50.1s (9/11) docker:desktop-linux
[+] Running 0/1.2s (9/11) docker:desktop-linux
[+] Building 50.4s (9/11) docker:desktop-linux
[+] Running 0/1.8s (9/11) docker:desktop-linux
[+] Building 51.0s (9/11) docker:desktop-linux
[+] Building 140.1s (11/12) docker:desktop-linux
=> [backend internal] load .dockerignore 0.0s
[+] Building 140.4s (11/12) docker:desktop-linux
[+] Running 0/10.5s (11/12) docker:desktop-linux
⠧ Service backend Building 140.8s
[+] Running 0/11.7s (11/12) docker:desktop-linux
[+] Building 141.9s (11/12) docker:desktop-linux
[+] Building 143.4s (11/12) docker:desktop-linux
[+] Running 0/1ternal] load .dockerignore 0.0s
[+] Building 144.3s (11/12) docker:desktop-linux
[+] Running 0/14.7s (11/12) docker:desktop-linux
[+] Building 144.9s (11/12) docker:desktop-linux
[+] Building 145.8s (11/12) docker:desktop-linux
⠙ Service backend Building 146.2s
[+] Running 0/17.1s (11/12) docker:desktop-linux
[+] Building 147.3s (11/12) docker:desktop-linux
[+] Running 0/17.7s (11/12) docker:desktop-linux
[+] Building 147.9s (11/12) docker:desktop-linux
[+] Running 0/18.0s (11/12) docker:desktop-linux
[+] Building 148.2s (11/12) docker:desktop-linux
⠸ Service backend Building 150.4s
[+] Running 0/10.4s (11/12) docker:desktop-linux
[+] Building 150.6s (11/12) docker:desktop-linux
[+] Running 0/11.0s (11/12) docker:desktop-linux
⠹ Service backend Building 151.3s
⠙ Service backend Building 152.2s
⠼ Service backend Building 152.5s
[+] Building 153.0s (11/12) docker:desktop-linux
=> [backend internal] load .dockerignore 0.0s
⠸ Service backend Building 153.4s
⠦ Service backend Building 153.7s
[+] Building 153.9s (11/12) docker:desktop-linux
[+] Running 0/1ternal] load .dockerignore 0.0s
[+] Building 154.5s (11/12) docker:desktop-linux
[+] Running 0/1ternal] load .dockerignore 0.0s
⠙ Service backend Building 155.2s
⠧ Service backend Building 155.8s
[+] Running 0/15.8s (11/12) docker:desktop-linux
[+] Building 156.0s (11/12) docker:desktop-linux
[+] Running 0/16.1s (11/12) docker:desktop-linux
[+] Building 156.3s (11/12) docker:desktop-linux
⠦ Service backend Building 156.7s
[+] Running 0/17.0s (11/12) docker:desktop-linux
[+] Building 157.2s (11/12) docker:desktop-linux
[+] Building 158.1s (11/12) docker:desktop-linux
[+] Building 163.4s (13/13) FINISHED docker:desktop-linux
=> [backend internal] load build definition from 0.0s
=> => transferring dockerfile: 563B 0.0s
=> [backend internal] load metadata for docker.io 1.4s
=> [backend auth] library/python:pull token for r 0.0s
=> [backend internal] load .dockerignore 0.0s
=> => transferring context: 430B 0.0s
=> [backend 1/6] FROM docker.io/library/python:3 15.9s
=> => resolve docker.io/library/python:3.13-slim@ 0.0s
=> => sha256:743e8656f41e5a014f244a19 251B / 251B 0.1s
=> => sha256:2293bd064819015c3a 12.48MB / 12.48MB 3.9s
=> => sha256:04f0ffcce2f65e66aa08 3.33MB / 3.33MB 2.2s
=> => sha256:4d2547c084994a809 28.04MB / 28.04MB 15.2s
=> => extracting sha256:4d2547c084994a809c138e688 0.4s
=> => extracting sha256:04f0ffcce2f65e66aa08c21a4 0.1s
=> => extracting sha256:2293bd064819015c3a5937e41 0.2s
=> => extracting sha256:743e8656f41e5a014f244a19a 0.0s
=> [backend internal] load build context 0.0s
=> => transferring context: 27.44kB 0.0s
=> [backend 2/6] WORKDIR /app 0.4s
=> [backend 3/6] RUN apt-get update && apt-get i 26.7s
=> [backend 4/6] COPY requirements.txt . 0.0s
=> [backend 5/6] RUN pip install --no-cache-dir 95.2s
=> [backend 6/6] COPY . . 0.1s
=> [backend] exporting to image 23.4s
=> => exporting layers 18.2s
=> => exporting manifest sha256:03eea86c3e851aa42 0.0s
=> => exporting config sha256:7987011e0c66eac2e32 0.0s
=> => exporting attestation manifest sha256:b3fe0 0.0s
=> => exporting manifest list sha256:130158bffec7 0.0s
=> => naming to docker.io/library/ai_research_ass 0.0s
[+] Running 4/1g to docker.io/library/ai_research_ 5.2s
✔ Service backend Built163.5s
✔ Network ai_research_assistant_app-network Created0.0s
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠋ Container ai_research_assistant-neo4j-1 Creating0.0
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠙ Container ai_research_assistant-neo4j-1 Creating0.1
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠹ Container ai_research_assistant-neo4j-1 Creating0.2
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠸ Container ai_research_assistant-neo4j-1 Creating0.3
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠼ Container ai_research_assistant-neo4j-1 Creating0.4
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠴ Container ai_research_assistant-neo4j-1 Creating0.5
[+] Running 4/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠦ Container ai_research_assistant-neo4j-1 Creating0.6
[+] Running 6/5esearch_assistant_neo4j_data" Created0.0s
✔ Service backend Built163.5s ✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Network ai_research_assistant_app-network Created0.0s ⠧ Container ai_research_assistant-neo4j-1 Creating0.7
✔ Volume "ai_research_assistant_neo4j_data" Created0.0s
✔ Volume "ai_research_assistant_neo4j_logs" Created0.0s
✔ Container ai_research_assistant-neo4j-1 Created0.8s
✔ Container ai_research_assistant-backend-1 Created0.0s
Attaching to backend-1, neo4j-1
neo4j-1 | Installing Plugin 'apoc' from /var/lib/neo4j/labs/apoc-*-core.jar to /var/lib/neo4j/plugins/apoc.jar
neo4j-1 | Applying default values for plugin apoc to neo4j.conf
neo4j-1 | Changed password for user 'neo4j'. IMPORTANT: this change will only take effect if performed before the database is started for the first time.
backend-1 | Traceback (most recent call last):
backend-1 | File "/usr/local/bin/uvicorn", line 8, in <module>
backend-1 | sys.exit(main())
backend-1 | ~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1161, in __call__
backend-1 | return self.main(*args, **kwargs)
backend-1 | ~~~~~~~~~^^^^^^^^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1082, in main
backend-1 | rv = self.invoke(ctx)
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1443, in invoke
backend-1 | return ctx.invoke(self.callback, **ctx.params)
backend-1 | ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 788, in invoke
backend-1 | return __callback(*args, **kwargs)
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/main.py", line 418, in main
backend-1 | run(
backend-1 | ~~~^
backend-1 | app,
backend-1 | ^^^^
backend-1 | ...<45 lines>...
backend-1 | h11_max_incomplete_event_size=h11_max_incomplete_event_size,
backend-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | )
backend-1 | ^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/main.py", line 587, in run
backend-1 | server.run()
backend-1 | ~~~~~~~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/server.py", line 62, in run
backend-1 | return asyncio.run(self.serve(sockets=sockets))
backend-1 | ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/asyncio/runners.py", line 195, in run
backend-1 | return runner.run(main)
backend-1 | ~~~~~~~~~~^^^^^^
backend-1 | File "/usr/local/lib/python3.13/asyncio/runners.py", line 118, in run
backend-1 | return self._loop.run_until_complete(task)
backend-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
backend-1 | File "/usr/local/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
backend-1 | return future.result()
backend-1 | ~~~~~~~~~~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/server.py", line 69, in serve
backend-1 | config.load()
backend-1 | ~~~~~~~~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/config.py", line 458, in load
backend-1 | self.loaded_app = import_from_string(self.app)
backend-1 | ~~~~~~~~~~~~~~~~~~^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/importer.py", line 24, in import_from_string
backend-1 | raise exc from None
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/importer.py", line 21, in import_from_string
backend-1 | module = importlib.import_module(module_str)
backend-1 | File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
backend-1 | return _bootstrap._gcd_import(name[level:], package, level)
backend-1 | ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
backend-1 | File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
backend-1 | File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
backend-1 | File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
backend-1 | File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
backend-1 | File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
backend-1 | File "/app/main.py", line 8, in <module>
backend-1 | from graph_processing import GraphProcessor
backend-1 | File "/app/graph_processing.py", line 12, in <module>
backend-1 | import community.community_louvain as community_louvain
backend-1 | ModuleNotFoundError: No module named 'community.community_louvain'
neo4j-1 | 2025-02-24 16:36:24.521+0000 INFO Logging config in use: File '/var/lib/neo4j/conf/user-logs.xml'
neo4j-1 | 2025-02-24 16:36:24.531+0000 INFO Starting...
backend-1 exited with code 1
neo4j-1 | 2025-02-24 16:36:25.568+0000 INFO This instance is ServerId{bc00c3cd} (bc00c3cd-d99d-4fc2-88e4-9f4dd9f93e86)
neo4j-1 | 2025-02-24 16:36:25.879+0000 INFO ======== Neo4j 5.17.0 ========
neo4j-1 | 2025-02-24 16:36:28.419+0000 INFO Bolt enabled on 0.0.0.0:7687.
neo4j-1 | 2025-02-24 16:36:28.833+0000 INFO HTTP enabled on 0.0.0.0:7474.
neo4j-1 | 2025-02-24 16:36:28.834+0000 INFO Remote interface available at http://localhost:7474/
neo4j-1 | 2025-02-24 16:36:28.835+0000 INFO id: A55AB33032CD6973B9FBAEBD7600CC2069EC84E7D9B5767A4725E27D816FF393
neo4j-1 | 2025-02-24 16:36:28.836+0000 INFO name: system
neo4j-1 | 2025-02-24 16:36:28.836+0000 INFO creationDate: 2025-02-24T16:36:26.285Z
neo4j-1 | 2025-02-24 16:36:28.836+0000 INFO Started.
neo4j-1 | 2025-02-24 16:36:59.573+0000 WARN [bolt-5] The client is unauthorized due to authentication failure.
neo4j-1 | 2025-02-24 16:36:59.582+0000 WARN [bolt-7] The client is unauthorized due to authentication failure.
neo4j-1 | 2025-02-24 16:36:59.595+0000 WARN [bolt-8] The client is unauthorized due to authentication failure.
neo4j-1 | 2025-02-24 16:36:59.613+0000 WARN [bolt-9] The client has provided incorrect authentication details too many times in a row.
neo4j-1 | 2025-02-24 16:36:59.623+0000 WARN [bolt-10] The client has provided incorrect authentication details too many times in a row.
neo4j-1 | 2025-02-24 16:36:59.636+0000 WARN [bolt-11] The client has provided incorrect authentication details too many times in a row.
neo4j-1 | 2025-02-24 16:37:15.908+0000 WARN [bolt-14] The client is unauthorized due to authentication failure.
neo4j-1 | 2025-02-24 16:37:15.923+0000 WARN [bolt-15] The client has provided incorrect authentication details too many times in a row.
neo4j-1 | 2025-02-24 16:37:15.939+0000 WARN [bolt-16] The client has provided incorrect authentication details too many times in a row.
backend-1 | Traceback (most recent call last):
backend-1 | File "/usr/local/bin/uvicorn", line 8, in <module>
backend-1 | sys.exit(main())
backend-1 | ~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1161, in __call__
backend-1 | return self.main(*args, **kwargs)
backend-1 | ~~~~~~~~~^^^^^^^^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1082, in main
backend-1 | rv = self.invoke(ctx)
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1443, in invoke
backend-1 | return ctx.invoke(self.callback, **ctx.params)
backend-1 | ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/click/core.py", line 788, in invoke
backend-1 | return __callback(*args, **kwargs)
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/main.py", line 418, in main
backend-1 | run(
backend-1 | ~~~^
backend-1 | app,
backend-1 | ^^^^
backend-1 | ...<45 lines>...
backend-1 | h11_max_incomplete_event_size=h11_max_incomplete_event_size,
backend-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | )
backend-1 | ^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/main.py", line 587, in run
backend-1 | server.run()
backend-1 | ~~~~~~~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/server.py", line 62, in run
backend-1 | return asyncio.run(self.serve(sockets=sockets))
backend-1 | ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/asyncio/runners.py", line 195, in run
backend-1 | return runner.run(main)
backend-1 | ~~~~~~~~~~^^^^^^
backend-1 | File "/usr/local/lib/python3.13/asyncio/runners.py", line 118, in run
backend-1 | return self._loop.run_until_complete(task)
backend-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
backend-1 | File "/usr/local/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
backend-1 | return future.result()
backend-1 | ~~~~~~~~~~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/server.py", line 69, in serve
backend-1 | config.load()
backend-1 | ~~~~~~~~~~~^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/config.py", line 458, in load
backend-1 | self.loaded_app = import_from_string(self.app)
backend-1 | ~~~~~~~~~~~~~~~~~~^^^^^^^^^^
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/importer.py", line 24, in import_from_string
backend-1 | raise exc from None
backend-1 | File "/usr/local/lib/python3.13/site-packages/uvicorn/importer.py", line 21, in import_from_string
backend-1 | module = importlib.import_module(module_str)
backend-1 | File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
backend-1 | return _bootstrap._gcd_import(name[level:], package, level)
backend-1 | ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-1 | File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
backend-1 | File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
backend-1 | File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
backend-1 | File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
backend-1 | File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
backend-1 | File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
backend-1 | File "/app/main.py", line 8, in <module>
backend-1 | from graph_processing import GraphProcessor
backend-1 | File "/app/graph_processing.py", line 12, in <module>
backend-1 | import community.community_louvain as community_louvain
backend-1 | ModuleNotFoundError: No module named 'community.community_louvain'
It looks like your `docker-compose up --build` command is progressing, but the build is taking a while. Here are a few observations and potential areas to check if you're experiencing issues:
1. **Obsolete `version` Key in `docker-compose.yml`**
- The warning at the beginning suggests removing the `version` field from your `docker-compose.yml` file since it is now obsolete.
2. **Build is Taking a Long Time**
- The `pip install --no-cache-dir -r requirements.txt` step took **95.2 seconds**, which might indicate large dependencies or network-related issues.
- If this is slowing down future builds, consider using **Docker BuildKit** (`DOCKER_BUILDKIT=1`) and caching dependencies.
3. **Neo4j Setup**
- Neo4j seems to be pulling successfully but is taking a while to start. If it's hanging on container creation:
- Check `docker logs ai_research_assistant-neo4j-1`
- Ensure Neo4j has sufficient memory allocated (especially if using Docker Desktop).
4. **Hanging on "Creating Container"**
- If your backend service or Neo4j container is taking too long to start:
- Try `docker ps` to see running/stopped containers.
- Run `docker-compose logs backend` or `docker-compose logs neo4j` to debug.
Are you seeing any errors, or is it just taking longer than expected?
gpt-4o