fix: Add SSH client and autoconfig routes for production

- Install openssh-client in production Django container for mail server management
- Copy .ssh keys into container with proper permissions
- Add explicit Traefik routes for autoconfig/autodiscover subdomains

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-01 18:03:40 -05:00
parent ae74b4c2ed
commit 06e0ec3d01
2 changed files with 23 additions and 0 deletions

View File

@@ -47,6 +47,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
gettext \ gettext \
# entrypoint # entrypoint
wait-for-it \ wait-for-it \
# SSH client for mail server management
openssh-client \
# cleaning up unused files # cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@@ -80,6 +82,10 @@ COPY --from=python-build-stage --chown=django:django ${APP_HOME} ${APP_HOME}
# make django owner of the WORKDIR directory as well. # make django owner of the WORKDIR directory as well.
RUN chown django:django ${APP_HOME} RUN chown django:django ${APP_HOME}
# Copy SSH keys for mail server management and set permissions
COPY --chown=django:django ./.ssh ${APP_HOME}/.ssh
RUN chmod 700 ${APP_HOME}/.ssh && chmod 600 ${APP_HOME}/.ssh/id_ed25519 || true
# Place executables in the environment at the front of the path # Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH" ENV PATH="/app/.venv/bin:$PATH"

View File

@@ -63,6 +63,23 @@ http:
tls: tls:
certResolver: letsencrypt certResolver: letsencrypt
# Email autoconfiguration subdomains
autoconfig-router:
rule: 'Host(`autoconfig.smoothschedule.com`)'
entryPoints:
- web-secure
service: django
tls:
certResolver: letsencrypt
autodiscover-router:
rule: 'Host(`autodiscover.smoothschedule.com`)'
entryPoints:
- web-secure
service: django
tls:
certResolver: letsencrypt
# Wildcard subdomain router for tenant subdomains # Wildcard subdomain router for tenant subdomains
# Each subdomain gets its own certificate via HTTP challenge # Each subdomain gets its own certificate via HTTP challenge
subdomain-router: subdomain-router: