I would like to run aweb server inside a Docker container that listens to a Unix socket, instead of to a port. I'm finding a lot of results on sharing the Docker socket, but I don't think that's what I want.
I want the host system to be able to connect to the Unix socket that's being listened to inside the container.
I'm using docker-compose, so the usual way of using -v
doesn't work.
My ngix site config:
server {
listen 80; listen [::]:80;
server_name foo.com www.foo.com;
location / {
proxy_pass http://unix:/var/lib/docker/volumes/app_shared/_data/app.https.sock:;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
docker-compose.yml
version: '3'
services:
web:
build: .
volumes:
- shared:/var/app
command: "npm start"
volumes:
shared:
Yet it says I can't connect to the socket, even though it exists at this location on the host.