Giter VIP home page Giter VIP logo

Comments (2)

vingertop avatar vingertop commented on June 12, 2024

Hi, I might help you out with this link: https://linuxhandbook.com/nginx-reverse-proxy-docker/. I use the repo's mentioned there successfully with many other docker-compose configs, including this one, after just minor adjustments. The first three environment vars are for the nginx+letsencrypt reverse proxy, also check the networks and expose, or use something like traefik:

version: "3"

services:
  webserver:
    build:
      context: ./bin/${PHPVERSION}
    container_name: "${COMPOSE_PROJECT_NAME}-${PHPVERSION}"
    restart: "always"
    expose:
      - "80"
    networks:
      - net
    links:
      - database
    volumes:
      - ${DOCUMENT_ROOT}:/var/www/html:rw
      - ${PHP_INI}:/usr/local/etc/php/php.ini
      - ${VHOSTS_DIR}:/etc/apache2/sites-enabled
      - ${APACHE_LOG_DIR}:/var/log/apache2
    environment:
      VIRTUAL_HOST: site1.fqdn
      LETSENCRYPT_HOST: site1.fqdn
      VIRTUAL_PORT: 80
      APACHE_DOCUMENT_ROOT: ${APACHE_DOCUMENT_ROOT}
      PMA_PORT: ${HOST_MACHINE_PMA_PORT}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      HOST_MACHINE_MYSQL_PORT: ${HOST_MACHINE_MYSQL_PORT}
  database:
    build:
      context: "./bin/${DATABASE}"
    container_name: "${COMPOSE_PROJECT_NAME}-${DATABASE}"
    restart: "always"
    ports:
      - "3306:3306"
    networks:
      - net
    volumes:
      - ${MYSQL_INITDB_DIR}:/docker-entrypoint-initdb.d
      - ${MYSQL_DATA_DIR}:/var/lib/mysql
      - ${MYSQL_LOG_DIR}:/var/log/mysql
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}

  redis:
    container_name: "${COMPOSE_PROJECT_NAME}-redis"
    image: redis:latest
    ports:
      - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379"

networks:
  net:
    external:
      name: net

from docker-compose-lamp.

MrOffline77 avatar MrOffline77 commented on June 12, 2024

Hey,
I totally get your point. Since this stack is focused for local development I'm going to close this issue. Production grade deployment is not in the scope of the project, since this would involve many more aspects of running software. But your are free to extend your own copy of the project with this feature.

from docker-compose-lamp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.