Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker | auto restart and container name #32

Merged
merged 2 commits into from
Apr 24, 2023

Conversation

jheeree
Copy link

@jheeree jheeree commented Mar 30, 2023

🗣 Description

Added parameters in docker-compose.yml file to restart containers automatically after a restart of the host machine. Also, added base identifiers to distinguish containers when more than 1 container is deployed.

💭 Motivation and context

I currently have the application deployed to a VPS, and after some changes I made locally, I noticed that these were not automatically lifted.

image

@damionmounts
Copy link
Contributor

Hello @jheeree,

I'll be able to throw some eyes at this PR next week

@damionmounts
Copy link
Contributor

🤔 Thoughts

🐳 Container Names

I agree on this change - however, adding name: decider to the top of the compose file would be optimal.
That both:

  • Gives us containers with clean names (no -1 hanging off of the end) and
  • Ensures our Network / Volume get a relevant name
    • I have an internal Decider repo clone on /internal and this one on /external - and Docker loves to prefix the Network/Volume with external_ or internal_ without the root name (I'll use name: internal-decider for my internal one to de-conflict naming)

♻️ Restart

I'm thinking a Restart Policy of unless-stopped would be more optimal.

This prevents the default on Debian/Ubuntu from launching any dev instances of Decider unintentionally.

On Debian and Ubuntu, the Docker service starts on boot by default.
- Docker systemd Defaults

@damionmounts damionmounts requested review from damionmounts and removed request for damionmounts April 24, 2023 07:04
@damionmounts damionmounts self-assigned this Apr 24, 2023
@damionmounts damionmounts merged commit 6d8569f into cisagov:develop Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants