Comments (2)
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.
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)
- Can't Use PHP Versions other than 8.0.19
- [BUG] Odd slow for app? Cant find logs HOT 2
- [SUGGESTION] Running docker-compose-lamp on resouce limited compute engines HOT 1
- [BUG] php version is always 8.0.19 HOT 1
- PHPMYADMIN AUTO LOGIN HOT 3
- [BUG] failed to solve: process "/bin/sh -c apt-get -y update --fix-missing" did not complete successfully: exit code: 100 HOT 2
- Documentation on how to tie in private composer package repository HOT 1
- [Suggestion] Update README to use `docker compose` instead of deprecated `docker-compose`
- [BUG] Default SSL setup gives SSL_ERROR_RX_RECORD_TOO_LONG in Firefox
- [BUG] MYSQL not starting - it says it has files in data folder, even when I clean it out --initialize specified but the data directory has files in it. Aborting. HOT 1
- [QUESTION] Why are the `werbserver` and `database` containers set to run when host machine boots? HOT 3
- [BUG] mysqli_sql_exception: No such file or directory HOT 1
- [QUESTION] how to enable igbinary? HOT 1
- phpmyadmin log in without a password!
- [BUG] Why php 8.1.2 when installed 8.3? HOT 1
- MySQL crashing on startup HOT 3
- How to add GMP?
- php handler: mod_php=> php-fpm HOT 1
- [BUG] MySQL crashes after an update = 8.4 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-compose-lamp.