mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
docker: rename docker/* files for consistency
This commit is contained in:
@@ -23,7 +23,7 @@ services:
|
|||||||
# - ./custom/www:/opt/chatmail-www
|
# - ./custom/www:/opt/chatmail-www
|
||||||
|
|
||||||
## Debug — mount scripts from the repo for live editing:
|
## Debug — mount scripts from the repo for live editing:
|
||||||
# - ./docker/files/setup_chatmail_docker.sh:/setup_chatmail_docker.sh
|
# - ./docker/files/chatmail-init.sh:/chatmail-init.sh
|
||||||
# - ./docker/files/entrypoint.sh:/entrypoint.sh
|
# - ./docker/files/entrypoint.sh:/entrypoint.sh
|
||||||
|
|
||||||
# environment:
|
# environment:
|
||||||
|
|||||||
@@ -77,14 +77,14 @@ ENV TZ=:/etc/localtime
|
|||||||
ENV PATH="/opt/cmdeploy/bin:${PATH}"
|
ENV PATH="/opt/cmdeploy/bin:${PATH}"
|
||||||
RUN ln -s /etc/chatmail/chatmail.ini /opt/chatmail/chatmail.ini
|
RUN ln -s /etc/chatmail/chatmail.ini /opt/chatmail/chatmail.ini
|
||||||
|
|
||||||
ARG SETUP_CHATMAIL_SERVICE_PATH=/lib/systemd/system/setup_chatmail.service
|
ARG CHATMAIL_INIT_SERVICE_PATH=/lib/systemd/system/chatmail-init.service
|
||||||
COPY ./docker/files/setup_chatmail.service "$SETUP_CHATMAIL_SERVICE_PATH"
|
COPY ./docker/files/chatmail-init.service "$CHATMAIL_INIT_SERVICE_PATH"
|
||||||
RUN ln -sf "$SETUP_CHATMAIL_SERVICE_PATH" "/etc/systemd/system/multi-user.target.wants/setup_chatmail.service"
|
RUN ln -sf "$CHATMAIL_INIT_SERVICE_PATH" "/etc/systemd/system/multi-user.target.wants/chatmail-init.service"
|
||||||
|
|
||||||
# Remove default nginx site config at build time (not in entrypoint)
|
# Remove default nginx site config at build time (not in entrypoint)
|
||||||
RUN rm -f /etc/nginx/sites-enabled/default
|
RUN rm -f /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
COPY --chmod=555 ./docker/files/setup_chatmail_docker.sh /setup_chatmail_docker.sh
|
COPY --chmod=555 ./docker/files/chatmail-init.sh /chatmail-init.sh
|
||||||
COPY --chmod=555 ./docker/files/entrypoint.sh /entrypoint.sh
|
COPY --chmod=555 ./docker/files/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
# Certificate monitoring as a proper systemd timer (not a background process)
|
# Certificate monitoring as a proper systemd timer (not a background process)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Check TLS certificate changes and reload services
|
Description=Check TLS certificate changes and reload services
|
||||||
After=setup_chatmail.service
|
After=chatmail-init.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Run container setup commands
|
Description=Run container setup commands
|
||||||
After=multi-user.target
|
After=multi-user.target
|
||||||
ConditionPathExists=/setup_chatmail_docker.sh
|
ConditionPathExists=/chatmail-init.sh
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/bash /setup_chatmail_docker.sh
|
ExecStart=/bin/bash /chatmail-init.sh
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
WorkingDirectory=/opt/chatmail
|
WorkingDirectory=/opt/chatmail
|
||||||
PassEnvironment=<envs_list>
|
PassEnvironment=<envs_list>
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
SETUP_CHATMAIL_SERVICE_PATH="${SETUP_CHATMAIL_SERVICE_PATH:-/lib/systemd/system/setup_chatmail.service}"
|
CHATMAIL_INIT_SERVICE_PATH="${CHATMAIL_INIT_SERVICE_PATH:-/lib/systemd/system/chatmail-init.service}"
|
||||||
|
|
||||||
# Whitelist only the env vars needed by setup_chatmail_docker.sh.
|
# Whitelist only the env vars needed by chatmail-init.sh.
|
||||||
# Forwarding all env vars (via printenv) would leak Docker internals,
|
# Forwarding all env vars (via printenv) would leak Docker internals,
|
||||||
# orchestrator secrets, and other unrelated variables into systemd.
|
# orchestrator secrets, and other unrelated variables into systemd.
|
||||||
env_vars="MAIL_DOMAIN CMDEPLOY_STAGES CHATMAIL_INI TLS_EXTERNAL_CERT_AND_KEY PATH"
|
env_vars="MAIL_DOMAIN CMDEPLOY_STAGES CHATMAIL_INI TLS_EXTERNAL_CERT_AND_KEY PATH"
|
||||||
sed -i "s|<envs_list>|$env_vars|g" "$SETUP_CHATMAIL_SERVICE_PATH"
|
sed -i "s|<envs_list>|$env_vars|g" "$CHATMAIL_INIT_SERVICE_PATH"
|
||||||
|
|
||||||
exec /lib/systemd/systemd "$@"
|
exec /lib/systemd/systemd "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user