Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Docker dev environment broken since migration to uv #191

Open
1 of 4 tasks
padbk opened this issue Jan 7, 2025 · 0 comments
Open
1 of 4 tasks

Bug: Docker dev environment broken since migration to uv #191

padbk opened this issue Jan 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@padbk
Copy link

padbk commented Jan 7, 2025

Description

The docker dev environment no longer works since #187

I've changed uv install to uv sync in the Dockerfile https://github.com/litestar-org/litestar-fullstack/blob/main/deploy/docker/dev/Dockerfile#L57

But after making this change I am getting Failed to start Vite process: [Errno 2] No such file or directory: 'npm' on docker compose up

It is not clear to me what additional changes need to be made, but will keep looking.

URL to code causing the issue

https://github.com/litestar-org/litestar-fullstack/blob/main/deploy/docker/dev/Dockerfile#L57

Steps to reproduce

1. Change all instances of `uv install` to `uv sync` in the dev Dockerfile
2. Run `docker compose up --build`

Logs

app-1       | Using Litestar app from env: 'app.asgi:app'
app-1       | Loading environment configuration from .env
app-1       | Starting Granian server process ────────────────────────────────────────────────
app-1       | ┌──────────────────────────────┬───────────────────────────────────────────────┐
app-1       | │ Litestar version             │ 2.13.0                                        │
app-1       | │ Debug mode                   │ Enabled                                       │
app-1       | │ Python Debugger on exception │ Disabled                                      │
app-1       | │ CORS                         │ Enabled                                       │
app-1       | │ CSRF                         │ Disabled                                      │
app-1       | │ OpenAPI                      │ Enabled path=/schema                          │
app-1       | │ Compression                  │ Disabled                                      │
app-1       | │ Template engine              │ JinjaTemplateEngine                           │
app-1       | │ Middlewares                  │ JWTCookieAuthenticationMiddleware,            │
app-1       | │                              │ LoggingMiddleware                             │
app-1       | └──────────────────────────────┴───────────────────────────────────────────────┘
app-1       | Starting Vite process with HMR Enabled ─────────────────────────────────────────
app-1       | Starting Vite process with command: ['npm', 'run', 'dev']
app-1       | Failed to start Vite process: [Errno 2] No such file or directory: 'npm'
app-1       | Stopping Vite process
app-1       | Vite process stopped.
app-1       | Traceback (most recent call last):
app-1       |   File "/workspace/app/.venv/bin/litestar", line 8, in <module>
app-1       |     sys.exit(run_cli())
app-1       |              ^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/litestar/__main__.py", line 6, in run_cli
app-1       |     litestar_group()
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/rich_click/rich_command.py", line 367, in __call__
app-1       |     return super().__call__(*args, **kwargs)
app-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
app-1       |     return self.main(*args, **kwargs)
app-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/rich_click/rich_command.py", line 152, in main
app-1       |     rv = self.invoke(ctx)
app-1       |          ^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
app-1       |     return _process_result(sub_ctx.command.invoke(sub_ctx))
app-1       |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
app-1       |     return ctx.invoke(self.callback, **ctx.params)
app-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
app-1       |     return __callback(*args, **kwargs)
app-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
app-1       |     return f(get_current_context(), *args, **kwargs)
app-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/litestar/cli/_utils.py", line 254, in wrapped
app-1       |     return func(*args, **kwargs)
app-1       |            ^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/litestar_granian/cli.py", line 382, in run_command
app-1       |     with _server_lifespan(env.app):
app-1       |   File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
app-1       |     return next(self.gen)
app-1       |            ^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/litestar/cli/commands/core.py", line 48, in _server_lifespan
app-1       |     exit_stack.enter_context(manager)  # type: ignore[arg-type]
app-1       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1       |   File "/usr/local/lib/python3.11/contextlib.py", line 517, in enter_context
app-1       |     result = _enter(cm)
app-1       |              ^^^^^^^^^^
app-1       |   File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
app-1       |     return next(self.gen)
app-1       |            ^^^^^^^^^^^^^^
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/litestar_vite/plugin.py", line 180, in server_lifespan
app-1       |     self._vite_process.start(command_to_run, self._config.root_dir)
app-1       |   File "/workspace/app/.venv/lib/python3.11/site-packages/litestar_vite/plugin.py", line 55, in start
app-1       |     self.process = subprocess.Popen(
app-1       |                    ^^^^^^^^^^^^^^^^^
app-1       |   File "/usr/local/lib/python3.11/subprocess.py", line 1026, in __init__
app-1       |     self._execute_child(args, executable, preexec_fn, close_fds,
app-1       |   File "/usr/local/lib/python3.11/subprocess.py", line 1955, in _execute_child
app-1       |     raise child_exception_type(errno_num, err_msg, err_filename)
app-1       | FileNotFoundError: [Errno 2] No such file or directory: 'npm'
app-1 exited with code 1

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)
@padbk padbk added the bug Something isn't working label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant