How do I use volume?

Hi, Pardon me for being a noob in Docker. I wanted to deploy this image from https://hub.docker.com/r/getsentry/relay I read the documentation (https://github.com/fullstorydev/relay-core/blob/master/docs/running.md) and it seems that it requires a single configuration file named relay.yaml has to be created first in /etc/relay/ folder. The Dockerfile of the image contains this line: VOLUME ["/work", "/etc/relay"] Which I asssumed to be a command to mount /work folder in the volume to /etc/relayfolder in the Docker container. This means that I just need to create a volume containing a single relay.yamlfile which will then be mounted to a /work folder in that container. To create that file, here's what I did: I created the file manually via Filebrowser template (https://github.com/brody192/filebrowser-template/pkgs/container/filebrowser-template). I placed the file in the root folder because it will be mounted to the container anyway. Afterwards I detached that volume and mounted it to the Docker container. However, it seems that the application still thinks that the config file that I created manually is not there, as if the volume is not mounted at all (2nd screenshot) My questions are: 1. Did I do it correctly? 2. Am I correct to assume that Railway volume would be used/mounted to the container via VOLUMEcommand in the Dockerfile? Sorry if my question is not really clear. I am really new to Docker. Thank you very much!
No description
No description
11 Replies
Percy
Percy5mo ago
Project ID: 9ee152a2-213f-489a-98a1-e37e510d6797
Celengan Babi
Celengan Babi5mo ago
9ee152a2-213f-489a-98a1-e37e510d6797
Brody
Brody5mo ago
have you read the readme? https://github.com/brody192/filebrowser-template?tab=readme-ov-file#template-features specifically the use volume root environment variable
Celengan Babi
Celengan Babi5mo ago
Hi @Brody, thank you for your reply! No, I wasn't aware of that. I will try with that env var to see if the file is placed correctly now. Thanks a lot! Do you happen to know if my assumption is correct as I have written in my 2nd question? I am really new to Docker and my assumption is that the "Railway volume" can be mounted using VOLUME command on Dockerfile.
Brody
Brody5mo ago
railway does not support the VOLUME directive in the dockerfile, you mount the volume via the UI https://docs.railway.app/guides/volumes relay can be configured mostly by environment variables, you might not even need a config file just straight deploy the docker image and set the applicable service variables
Celengan Babi
Celengan Babi5mo ago
Hi, thank you so much! I managed to deploy it just by using environment variables. I am not sure about the env var for the port number though, my test rrequest doesn't seem to go thru the instance (I tried with port 3000).
Fragly
Fragly5mo ago
Make sure you're listening on the PORT that railway provides https://docs.railway.app/guides/public-networking#railway-provided-port
Celengan Babi
Celengan Babi5mo ago
Railway doesn't seem to provide PORT environment variable for my Relay instance so I added a new one, defined the port myself (port 8080) and use the same port as my Relay port config. Did I do it correctly?
No description
Brody
Brody5mo ago
if relay does listen on 8080 then yes what did you set the host to?
Celengan Babi
Celengan Babi5mo ago
I set it to 0.0.0.0 since it is a Docker container. update: so apparently the Relay configuration is correct. As mentioned by @Brody and @Fragly, I need to make sure to set the application to listen to the PORT that is provided by Railway (or set the PORT env var manually) I will close this ticket because my issue is apparently something else. Somehow my Sentry host wouldn't accept the requests that are relayed thru Relay. Thank you again!
Brody
Brody5mo ago
happy to help where we can!
Want results from more Discord servers?
Add your server
More Posts