[Beginer - Container] How can I craete a project with an existing container


I have created a container and I installer Ubuntu, Apache, MariadDN, InvoiceNinja.
All work fine, excepted Apache and MariaDB does not start when I start my container.
I heard, those setting has to be in a composer file and for that I have to create a project and past the compose file.
I also red, while I create a project, I have to specify an image (Ubuntu) in the composer file and it will create the container following the composer file, where are define the ports and the maped volume.

Then if I create a project,
Q1: how can I create a project without specifying the image, and instead of that, the project use my existing container?
Q2: Is possible to generate a compose file according to my existing container?

I absolutely never work on a composer file, and I have no idea how, I have to specify the setting.

My container:

  1. user the port 5151:80 (NAS:container)
  2. Apache and MariaDB is already installed
  3. InvoiceNinja is install in /var/www/invoiceninja/

Q2.1: How can I write a basic composer file according to my existing container?

Q3: What would be the recommanded maping folder for my existing container?

  1. /volume1/docker/ninja to /var/www/invoiceninja
  2. /volume1/docker/ninja to /var/www/
  3. /volume1/docker/ninja to /home/

Q4: Let’s say, I have not an exiting container yet, What would be the recommanded maping folder if I have not created a container, and the container will be install with the process, and then later, I install Apache, MariaDB, etc?

  1. /volume1/docker/ninja to /var/
  2. /volume1/docker/ninja to /etc/
  3. /volume1/docker/ninja to / (root)

Many thanks for your clarification and help


Sorry, I don’t have much experience with Docker.

Have you seen this video?