Skip to content

Commit

Permalink
feat: add sshd and crond containers (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
esolitos authored Sep 14, 2023
1 parent 2fed7fb commit fbc3365
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 13 deletions.
9 changes: 9 additions & 0 deletions templates/drupal-cron/default.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG BASE_TAG=8-dev
FROM wodby/drupal-php:${BASE_TAG}

ARG COPY_FROM=.
ARG COPY_TO=.
COPY --chown=1000:1000 ${COPY_FROM} ${COPY_TO}

# Copy the required crontab file
COPY ${COPY_FROM}/infrastructure/docker/cron/www-data.crontab /etc/crontabs/www-data
13 changes: 13 additions & 0 deletions templates/drupal-cron/default.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git/
.ddev/
.docker/

.github/
.idea/
.travis/

/docker-compose*.yml

/deploy/*
/infrastructure/terraform/
/logs/*
12 changes: 4 additions & 8 deletions templates/drupal-php/default.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG COPY_FROM
ARG COPY_TO
ARG BASE_TAG=8-dev
FROM wodby/drupal-php:${BASE_TAG}

ARG COPY_FROM=.
ARG COPY_TO=.
COPY --chown=1000:1000 ${COPY_FROM} ${COPY_TO}

# Copy the required crontab file
COPY ${COPY_FROM}/infrastructure/docker/cron/www-data.crontab /etc/crontabs/www-data
21 changes: 21 additions & 0 deletions templates/drupal-sshd/default.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG BASE_TAG=8-dev
FROM wodby/drupal-php:${BASE_TAG}

ARG COPY_FROM=.
ARG COPY_TO=.
COPY --chown=1000:1000 ${COPY_FROM} ${COPY_TO}

USER root

# Copy Tailscale binaries from the tailscale image on Docker Hub.
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /var/runtime/tailscaled
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscale /var/runtime/tailscale
RUN mkdir -p /var/run && ln -s /tmp/tailscale /var/run/tailscale && \
mkdir -p /var/cache && ln -s /tmp/tailscale /var/cache/tailscale && \
mkdir -p /var/lib && ln -s /tmp/tailscale /var/lib/tailscale && \
mkdir -p /var/task && ln -s /tmp/tailscale /var/task/tailscale


COPY ${COPY_FROM}/infrastructure/docker/sshd/init-tailscale /docker-entrypoint-init.d/

USER wodby
6 changes: 6 additions & 0 deletions templates/drupal-sshd/init-tailscale
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

mkdir -p /tmp/tailscale
/var/runtime/tailscaled --tun=userspace-networking --socks5-server=localhost:1055 &
/var/runtime/tailscale up --ssh --authkey=${TAILSCALE_AUTHKEY} --hostname=${TAILSCALE_NAME}
echo "Tailscale started!"
9 changes: 4 additions & 5 deletions templates/nginx/default.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG COPY_FROM
ARG COPY_TO
ARG BASE_TAG=8-dev
FROM wodby/nginx:${BASE_TAG}

ARG COPY_FROM=.
ARG COPY_TO=.
COPY --chown=1000:1000 ${COPY_FROM} ${COPY_TO}

# Copy error template
Expand Down

0 comments on commit fbc3365

Please sign in to comment.