Hi All, I'm currently trying to run ory kratos in...
# ory-selfhosting
o
Hi All, I'm currently trying to run ory kratos in a docker container on my server. When starting the container I am getting an error that the configuration file cannot be found.
error=map[message:open /etc/config/kratos/kratos.yml: no such file or directory stack_trace:
However, when I attach to the container's terminal, I can actually see the file being there.
ls -la /etc/config/kratos
-rw-r--r--    1 root     root          1929 Mar 18 23:20 kratos.yml
If I then run the serve command manually, it works as expected. So my issue only happens during the initial startup of the container.
kratos serve -c /etc/config/kratos/kratos.yml --watch-courier
Here's the compose config:
Copy code
kratos:
    depends_on:
      - kratos-migrate
    image: oryd/kratos:v1.2.0
    restart: unless-stopped
    environment:
      - DSN=<redacted>
      - LOG_LEVEL=trace
    volumes:
      - type: bind
        source: /etc/deployment/ory/kratos
        target: /etc/config/kratos
    command: serve -c /etc/config/kratos/kratos.yml --watch-courier
    networks:
      - intranet
I know 1.2 is not the latest version, but I was playing around with this already a few months back and didn't have any issues then. Not sure what's going on now. If anyone has any idea, I'd love to hear. Thank you!
a
Based on the config you gave you need to put your
kratos.yml
into
/etc/deployment/ory/kratos
. As that is the Host path.
o
@ancient-magazine-81061 That's where it is on the host machine. The other path that I wrote down is inside the container already
The file is actually there in the container. If I attach to the container and run the service command and attach the config file with -c it works as expected as well, which makes this slightly confusing to me
a
Then it would be better for you to use the following one instead: https://github.com/ory/kratos/blob/d68736bed28e956e52a54fef5591bd4c88de6594/quickstart.yml#L30
o
@ancient-magazine-81061 I don't really understand what you mean. That quickstart is exactly what mine is based on, and I don't really see anything different either
a
I only see part of your compose file. From that and what you said you are using version 1.2.0. Upgrade to see if the problem is resolved. You can even remove the docker containers and run
docker system prune -a
. It does the following:
Copy code
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them
  - all build cache

Are you sure you want to continue? [y/N]
o
Just to be clear, all the other parts work perfectly. It's only kratos that doesn't work, and when running the command manually from within the container, it works
It's only not able to read my config file on startup for some unknown reason
I will try upgrading but I don't know how easy that is. I guess all the rest will have to be bumped as well?
Hydra etc
a
First change the config file permissions before updating and updating one service does not mean you have to update another.
o
Alright, will try bumping kratos in a minute then
👍 1