Closed guuseh closed 6 months ago
so my teacher and I found the answer and it's very frustrating but easy - in my Docker Desktop general settings, my sharing implementation was on 'VirtioFS' and 'Use Visualization framework' was checked. When changing that to 'gRPC FUSE' and unchecked all my problems disappeared. These were the settings Docker came with so had no idea that they should be changed but happy we found out!
Hi.
I'm pretty new to this so apologies in advance if my wording is not clear or if the formatting is wrong, or if this is entirely the wrong place to post this.
I'm trying to connect to postgres through a docker container with deno, but as soon as I import postgres (from "https://deno.land/x/postgresjs@v3.4.3/mod.js") the container with my api service exits with code 139. I will write my code down below and try to be clear about when the problems start. I'm getting the code from a course I'm following, and it works for everyone else. Previously I also had trouble connecting to postgresjs but I was told with the new version 4.3.2 it should be fixed however it still won't let me connect. I am using a MacBook Pro with intel i5 on Ventura 13.2.
My folder structure: | api |-- app.js |-- app-run.js |-- deps.js |-- Dockerfile | docker-compose.yml | project.env
app.js:
app-run.js:
deps.js:
Dockerfile:
docker-compose.yml:
project.env:
The container runs fine before I add the dependency - I can access it with
$ docker exec -it postgresql_database psql -U username database
so adding the database itself is not a problem. It's when I want to access it from within the app with the database client that it stops running.Before I add the env_file to the api service in docker-compose.yml it obviously gives me an error that the connection was refused, but the api container doesn't exit with code 139. I don't know if that's of any use but I figured the more information the better. This is the console when trying to run the container without the env_file added to the api service:
And this is the console when trying to run it with all the code as described above. It exits first with code 0 and then on every subsequent refresh of localhost it exits with code 139:
Does anyone know how to resolve this? I would really like to use this postgresjs client since that's the one we use in the course but I'm afraid that if I can't solve it I will have to use a different one and do a lot of extra work trying to figure out how to make that work AND hand in my assignments correctly...
If any more information is needed please let me know, I'll try my best to be as precise as possible!
Thank you!