alseambusher / crontab-ui

Easy and safe way to manage your crontab file
https://lifepluslinux.blogspot.com/2015/06/crontab-ui-easy-and-safe-way-to-manage.html
MIT License
2.91k stars 480 forks source link

add this to an already existing container #243

Open arcanisgk opened 1 year ago

arcanisgk commented 1 year ago

I'm using docker and I don't see the correct way to merge two images... so I wouldn't want to have to add a separate container because I don't know how to connect it to the other container where I already have something running before...

Any way to add this to an already existing container with the following previous configuration:

docker-compose.yml:

version: "3.9"

services:

  reverse-proxy:
    env_file:
      - .env
    container_name: Proxy-Server
    image: nginxproxy/nginx-proxy
    restart: always
    depends_on:
      - webserver
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./config/ssl:/etc/nginx/certs
    extra_hosts:
      - "lh-stack.dock:127.0.0.1"
      - "pma.lh-stack.dock:127.0.0.1"
    ports:
      - 80:80
      - 443:443
    networks:
      - lamp-network
    environment:
      - TRUST_DOWNSTREAM_PROXY=true
      - ENABLE_WEBSOCKETS=true
    privileged: true
    tty: true

  webserver:
    env_file:
      - .env
    container_name: LH-STACK-Web-Server
    build:
      context: ./bin/php81
      dockerfile: Dockerfile.secure
      args:
        VIRTUAL_HOST: lh-stack.dock
    restart: always
    expose:
      - 80
    networks:
      - lamp-network
    volumes:
      - ./../project:/var/www/html:rw
      - ./../project/public:/var/www/html/public:rw
      - ./config/vhost:/etc/apache2/sites-enabled
      - ./config/php/php.ini:/usr/local/etc/php/php.ini
      - ./config/cron:/etc/cron-task
      - ./log/apache2:/var/log/apache2
      - ./log/cron:/var/log/cron
    environment:
      VIRTUAL_HOST: lh-stack.dock
      LH_WEB_MASTER: icarosnet@gmail.com
      LH_APACHE_DOCUMENT_ROOT: /var/www/html
      LH_DOCUMENT_ROOT: /public
    extra_hosts:
      - "host.docker.internal:host-gateway"
    labels:
      - "lh2.setup.description=Web Server"
      - "lh2.setup.role=webserver"
    privileged: true
    tty: true

Dockerfile:

FROM php:8.1-apache-bullseye

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update &&  \
    apt-get upgrade -y --no-install-recommends --fix-missing

RUN apt-get install -y --no-install-recommends --fix-missing tzdata sed build-essential dialog nano apt-utils cron wget git curl zip openssl gettext-base libnss3-tools

RUN apt-get -y autoremove && \
    apt-get clean

RUN a2enmod rewrite 
RUN a2enmod ssl 
RUN a2enmod headers 
RUN a2enmod proxy_wstunnel

RUN service apache2 restart

RUN mkdir -p /var/log/cron && \
    chmod 755 /var/log/cron && \
    touch /var/log/cron/cron.log

CMD cat /etc/cron-task/new-task >> /etc/cron.d/cron-task && \
    chmod 0644 /etc/cron.d/cron-task && \
    cron && \
    /usr/local/bin/apache2-foreground && \
    tail -f /var/log/cron/cron.log
stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.