Open regystro opened 1 year ago
Hi, sorry about that.
It looks like the app volume in docker-compose.yml
is overriding the node_modules/
directory built by the Dockerfile. As a temporary fix, just run yarn install
on host and try again.
Hold on, why would you need to mount the whole directory? Just remove the volume and command lines from the docker-compose file, it works perfectly without having to install node modules on the host :)
Steeven9 is correct, the following is working fine:
diff --git a/docker-compose.yml b/docker-compose.yml
index fca6735..4a82d1a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,11 +3,8 @@ version: '3'
services:
web:
build: .
- volumes:
- - ./:/app
ports:
- '3000:3000'
- command: yarn dev
environment:
REDIS_URL: redis://redis:6379
HOST: '0.0.0.0'
The /docker-compose.yml
is intended for development, so having the files inside Docker change when the files outside are changed is essential for DX. 🙂
I usually use a separate docker-compose.yml
file for deployment, outside the repo. If we want to include one here without the volume and yarn dev
lines, we could call it docker-compose.prod.yml
?
Fair enough, but tbh for development why not run nodemon on the host machine directly since you have to install node modules anyway? You could just spin up redis with docker run
on the side :)
That's certainly one way of doing it. Generally, I prefer to either keep everything in Docker or not use it at all.
I wonder if there's a way to tell Node to keep node_modules
somewhere else, where it won't be overridden by the volume?
Ran into this as well when trying to build an arm64 image on my maschine since none was available on Docker Hub. Thanks for the temporary fix!
Is there a way I could contribute the arm64 build? Might be useful since this is a very low-resource service, so it would do great on smaller boxes like SBCs.
Is there a way I could contribute the arm64 build? Might be useful since this is a very low-resource service, so it would do great on smaller boxes like SBCs.
I'm not sure what this would involve. Perhaps changing the deployment scripts (push.yml and deploy.yml) in some way? If you can figure out how to do it, please go ahead and open a PR. You can use act
to test the GitHub actions locally.
Hi.
I get this error when deploying locally:
Thanks for your effort and sharing.