Initial config in Docker #96
-
Hey there, I'm able to get things up and running in docker, but in what seems like a round-about way and I wanted to see if there's a better way. For example, if I try to start a container by using: It will create the container and the container will run then immediately exit due to email notifications not being configured yet: So instead, I create a container by using this: Which allows me to keep it running long enough to actually configure email notifications via terminal by typing I'm a total docker noob and self-taught so apologies if I'm totally missing something very obvious... My desire is to have it auto-search in the background when the container is started and avoid having to manually input via terminal each time it's loaded. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hey @zswickliffe this is a great question, I'm so happy to share some docker / camply knowledge. I've got some more information here so don't mind some of the duplicated content in my response. When you run
When camply detects a So for your docker container there are two ways to pass your email set up, either by setting the environment variables or by sharing a local docker run -d \
--name PNW_Sites \
--env EMAIL_TO_ADDRESS="[email protected]" \
--env EMAIL_USERNAME="[email protected]" \
--env EMAIL_PASSWORD="password12345" \
juftin/camply:latest \
camply campsites \
--rec-area 2835 \
--rec-area 2881 \
--rec-area 1120 \
--start-date 2022-07-30 \
--end-date 2022-08-01 \
--nights 2 \
--continuous \
--polling-interval 5 \
--search-forever \
--notifications email Or alternatively you can create your own docker run -d \
--name PNW_Sites \
--volume /local/path/to/.camply:/home/camply/.camply \
juftin/camply:latest \
camply campsites \
--rec-area 2835 \
--rec-area 2881 \
--rec-area 1120 \
--start-date 2022-07-30 \
--end-date 2022-08-01 \
--nights 2 \
--continuous \
--polling-interval 5 \
--search-forever \
--notifications email Using a YAML Configuration file is another nice way to do it in docker so I recommend checking that out too - you can share it into the docker container just like the One other really nice way to do all of this is with docker compose where you can put all of the docker configuration into a Here's your services:
camply:
container_name: PNW_Sites
image: juftin/camply:latest
environment:
EMAIL_TO_ADDRESS: "[email protected]"
EMAIL_USERNAME: "[email protected]"
EMAIL_PASSWORD: "password12345"
command: >
camply campsites
--rec-area 2835
--rec-area 2881
--rec-area 1120
--start-date 2022-07-30
--end-date 2022-08-01
--nights 2
--continuous
--polling-interval 5
--search-forever
--notifications email then you can bring it up with Hopefully this all helps, let me know if you're able to get it going. |
Beta Was this translation helpful? Give feedback.
-
Oh man, what an amazing response. I think I'm finally understanding the way docker works (previously I was just running in ubuntu). Thank you so much!! |
Beta Was this translation helpful? Give feedback.
hey @zswickliffe this is a great question, I'm so happy to share some docker / camply knowledge. I've got some more information here so don't mind some of the duplicated content in my response.
When you run
camply configure
locally or in docker it creates a file called.camply
in your home folder (the home folder is in different default locations depending on whether you're on a mac, linux, or pc). Here's what that.camply
file looks like: