question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Docker] Restructure Docker/Docker-Compose setup

See original GitHub issue

I find it really weird that you have to download a zip file with a structure of empty folders and some files. Usually the needed files are within the image and the folders would be created by the program itself.

This means that auth.js ; default.json and encrypted.json should be created upon the first container start if they don’t exist.

encrypted.json and default.json seem to serve the same purpose.

Or is there a specific reason that auth.js needs to be mounted outside the container?

It’s best practice to just show what volumes to map, what ports to forward and which environment variables to set in the Readme file, so there shouldn’t be the need to download an entire zip with file structure.

Furthermore, executables and zip files should be removed from the github repo long term.

Despite my suggestions, I really enjoy the work you have put into it 😃

Best regards.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Tzahi12345commented, Jul 1, 2020

I was thinking about this yesterday, and I realized we don’t actually need to make any modifications anywhere to have the automatic folder creation work (so no mkdirs necessary).

Basically, if you set up a mount in the docker-compose.yml and the host-side folder doesn’t exist, it will autocreate one – this is the exact functionality we need! The container then correctly handles the empty folders (meaning config and db files get rightly made).

So for the next release (coming up in the next day or so) I’ll just have users use the docker-compose and nothing else. Once that’s done, I think everything else in this issue is addressed, so I’ll close this issue then.

1reaction
UnlimitedCookiescommented, Jul 1, 2020

Actually, if you only want to mkdir if the directory does not exist you need to put an ! in front of the -d flag. Like this:

[ ! -d /path/to/dir ] && mkdir -p /path/to/dir

(And this does not need to be bash; any POSIX compliant shell will do; Arrays are a bash only feature, but they’re not needed in this case though.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Try Docker Compose - Docker Documentation
Try Docker Compose. This tutorial is designed to introduce the key concepts of Docker Compose whilst building a simple Python web application.
Read more >
How to use Docker containers and Docker Compose for Deep ...
Learn how to containerize a deep learning model using Docker. ... The first thing we need to do is install the docker engine...
Read more >
Deploy a PHP App with docker compose to production
For this tutorial we will use docker compose to build the containers as well as to run them "in production", i.e. on the...
Read more >
invoiceninja/dockerfiles: Docker files for Invoice Ninja - GitHub
All you need to do is initialise Kubernetes (available with Docker Desktop), install Helm, and spin up Invoice Ninja using the steps provided...
Read more >
Setting Up Docker Compose - Tilt
Docker Compose helps you define microservice apps that run in multiple containers. Most Tilt documentation uses Kubernetes to run multiple containers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found