Support portainer#22
Conversation
Remove the hard requirement for the `.env` file inside the repository. This is to be updated so that portainer can use this repository.
Add environment variable support inside the docker-compose.yml file. This allow for portainer to setup variables.
Setup the ports to be a list instead of the current map design. This is a hard requirement by portainer.
Healthcheck for the container requires to have the port `8080` setup. This commit now changes the internal port to be 8080 while the public port is defined by the env file.
Whoops! `REDIS_URI` was missing! This fixes the issue!
This hostname field is probably not required, that's why it's being removed.
Add the PROXY_HEADER env variable back into the docker-compose.yml file
|
|
|
I think it's cleaner for Portainer setups to have it as env_file:
- stack.envinstead of duplicating a bunch of variables. |
|
I mean that is a solution as well for it. But I'm not sure if it'll work well for portainer as then |
|
Yeah yeah we could add This way with duplicating the variables in compose file:
I would personally go with my implementation over Edit: I would be okay if there's a way to set a soft dependency for the env file but I'm not sure if that's a thing. |
|
Having a unified docker compose file for both standalone docker compose installations and Portainer is generally a bad idea imo. |
|
Oh! I didn't think of that honestly! That's a good idea! I'll go make a docker compose file specifically for portainer without modifying the old |
Revert docker-compose.yml to be the same as the actual branch in the decision of making a compose file specifically for portainer.
Add dockerfile which is only to be used for portainer.
Hardcode `REDIS_URI` into the docker compose file for portainer.
Hardcode `HOST` to `0.0.0.0` in the portainer compose file.
|
Just as an FYI, this PR isn't ready as-is. The documentation for portainer needs to be added. I'll write the documentation if the PR becomes approved. |
|
Hm maybe default values should be put in these lines: Lines 11 to 12 in 477392d Let's say With this function: func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}Because the healthcheck is working on port 8080: Line 17 in 477392d Then there would be no reason to define the host and port in the |
|
can you explain why this is necessary? it seems just the same as the normal docker-compose file, other than renaming .env to stack.env and adding environment:
PORT: 8080
HOST: 0.0.0.0
REDIS_URI: redis:6379
ports:
- ${PORT}:8080/tcpwhy are these necessary? the three environment variables are already specified in |
|
Portainer demands the stack.env when deploying via git, it doesn't read the .env file.
Sent from Proton Mail Android
…-------- Original Message --------
On 6/23/24 4:28 PM, vee wrote:
can you explain why this is necessary? it seems just the same as the normal docker-compose file, other than renaming .env to stack.env and adding
environment
:
PORT
:
8080
HOST
:
0.0.0.0
REDIS_URI
:
redis:6379
ports
:
-
${PORT}:8080/tcp
why are these necessary? the three environment variables are already specified in .env and PORT via the override. Why the rename to stack.env?
—
Reply to this email directly, [view it on GitHub](#22 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AHGL5YJ3EHMT6R6BVEC6L3DZI3LPPAVCNFSM6AAAAABJYNJEXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVGAYTCNRSGY).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
well thank you for the contribution, but i don't think there is any interest from our side to merge this. we don't know how portainer works and it seems unreasonable to have two almost duplicated configs, especially considering it seems to me as if this config force-overrides some values specified in .env, which is poor user experience. at this time, we also have no plans to publish to any container hub; it seems kinda pointless, considering it's just one simple git clone it would probably be best for you to just keep this as your personal fork! |

This PR basically just allows for the repo to be used in portainer.
Explained functionality: Create docker compose file specific for portainer. This file needs to be setup in the repository, or the users need to create their own forks of this project and maintain it. If an official image were published on an OCI repository there would be no need for this PR.
Notes:
8080is used in healthchecks so I've hardcoded the internal port to8080,$PORTnow affects only the host port.