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

Updated Docker container build #52

Closed
arabcoders opened this issue Jun 30, 2022 · 3 comments · Fixed by #56
Closed

Updated Docker container build #52

arabcoders opened this issue Jun 30, 2022 · 3 comments · Fixed by #56
Assignees
Labels
bug Something isn't working

Comments

@arabcoders
Copy link
Contributor

arabcoders commented Jun 30, 2022

Hi, I've made an updated docker container build to take advantage of the new ENV variables.

FROM alpine:latest

ENV MANGAL_VERSION=v2.1.1
ENV MANGAL_CONFIG_PATH=/config/mangal.toml
ENV MANGAL_DOWNLOAD_PATH=/downloads
ENV MANGAL_USER=abc
ENV MANGAL_UID=1000
ENV MANGAL_GID=1000

WORKDIR "/config"

RUN mkdir -p "${MANGAL_DOWNLOAD_PATH}" && addgroup -g "${MANGAL_GID}" "${MANGAL_USER}" && adduser \
    --disabled-password \
    --gecos "" \
    --home "$(pwd)" \
    --ingroup "${MANGAL_USER}" \
    --no-create-home \
    --uid "${MANGAL_UID}" \
    "${MANGAL_USER}" && \
    chown abc:abc /config "${MANGAL_DOWNLOAD_PATH}"

ADD https://github.com/metafates/mangal/releases/download/${MANGAL_VERSION}/mangal-linux-amd64 /usr/local/bin/mangal

RUN chmod +x /usr/local/bin/mangal

USER "${MANGAL_USER}"

ENTRYPOINT ["/usr/local/bin/mangal"]

I think MANGAL_CONFIG_PATH is kind of incorrectly named, as of v2.1.1 it points to a FILE directly not a PATH, this might cause misinterpretation as i did when i was updating my docker container. I think it should take PATH which gives you the possibility in the future to migrate config files when breaking changes happens.

For example, right now config is at mangal_v1.toml, in the future you make breaking change, you can create mangal_v2.toml and migrate settings from mangal_v1.toml.

Also, making more config options configurable via ENV variables is really helpful. prime example at least in my case is formats.default i always set it to cbz

@arabcoders arabcoders added the bug Something isn't working label Jun 30, 2022
@metafates
Copy link
Owner

Hi! You mean making MANGAL_CONFIG_PATH point to the config directory and then mangal will choose which config file to use?

@arabcoders
Copy link
Contributor Author

Hi! You mean making MANGAL_CONFIG_PATH point to the config directory and then mangal will choose which config file to use?

In essence yes, it should point to directory instead of a file.

@metafates
Copy link
Owner

Okay, that makes more sense, agree. Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants