I'm trying to setup an nginx container via docker-compose. I have a custom configuration I'd like to use. I make the config available on a volume that is shared with the container.
nginx:
volumes:
- shared:/shared
image: nginx
ports:
- "8080:80"
- "443:443"
command: /bin/bash -c ./shared/nginx_test.conf
Here is the configuration file:
daemon off;
http {
server {
location / {
root /shared/data/www;
}
location /images/ {
root /data;
}
}
}
When I do a docker-compose up, I get errors for each line in the config that say the command is not found. e.g. ./shared/nginx_test.conf: line 1: daemon: command not found, ./shared/nginx_test.conf: line 3: http: command not found and so on.
I tried following the guide here. Any ideas on why the commands are not found by nginx?