-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mario Enrico Ragucci <[email protected]>
- Loading branch information
Showing
2 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
FROM alpine:latest | ||
LABEL maintainer="[email protected]" | ||
LABEL description="tinymfa is a time based one time pad (TOTP) solution written in golang. It implements RFC 6238." | ||
EXPOSE 57687 | ||
|
||
ARG ARCH=amd64 | ||
ARG USER_ID=57687 | ||
ARG GROUP_ID=57687 | ||
|
||
USER root | ||
RUN mkdir -p /opt/go-tiny-mfa/bin && mkdir -p /opt/go-tiny-mfa/secrets && touch /opt/go-tiny-mfa/secrets/.placeholder | ||
RUN addgroup --gid ${GROUP_ID} tinymfa && adduser --no-create-home --disabled-password --ingroup tinymfa --shell /bin/bash --home /opt/go-tiny-mfa --uid ${USER_ID} tinymfa | ||
RUN chown -R ${USER_ID}:${GROUP_ID} /opt/go-tiny-mfa | ||
RUN mkdir -p /opt/go-tiny-mfa/bin && \ | ||
mkdir -p /opt/go-tiny-mfa/secrets && \ | ||
addgroup --gid ${GROUP_ID} tinymfa && \ | ||
adduser \ | ||
--no-create-home --disabled-password \ | ||
--ingroup tinymfa --shell /bin/sh \ | ||
--home /opt/go-tiny-mfa --uid ${USER_ID} tinymfa && \ | ||
chown -R ${USER_ID}:${GROUP_ID} /opt/go-tiny-mfa | ||
VOLUME [ "/opt/go-tiny-mfa/secrets" ] | ||
COPY --chown=${USER_ID}:${GROUP_ID} build/go-tiny-mfa-${ARCH} /opt/go-tiny-mfa/bin/tiny-mfa | ||
|
||
USER tinymfa | ||
HEALTHCHECK --interval=5s --timeout=5s --start-period=30s CMD /opt/go-tiny-mfa/bin/tiny-mfa --healthcheck | ||
HEALTHCHECK --interval=5s --timeout=5s --start-period=30s CMD ["/opt/go-tiny-mfa/bin/tiny-mfa", "--healthcheck"] | ||
CMD ["/opt/go-tiny-mfa/bin/tiny-mfa"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters