Skip to content

Instantly share code, notes, and snippets.

@Gabri
Last active November 11, 2020 08:22
Show Gist options
  • Save Gabri/360ff3f92815f61d7fe9b424b7c60d3c to your computer and use it in GitHub Desktop.
Save Gabri/360ff3f92815f61d7fe9b424b7c60d3c to your computer and use it in GitHub Desktop.
[docker compose mysql + phpmyadmin] port phpmyadmin 8306 root/secret #docker
version: '3.7'
# Services
services:
# Nginx Service
web:
container_name: ${PROJECT_NAME}_webngx_${VERSION_ID}
image: nginx:1.17-alpine
ports:
- ${HTTP_PORT_EXPOSED}:80
volumes:
- ./app:/var/www/php:ro
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
environment:
PROJECT_NAME: ${PROJECT_NAME}
depends_on:
- php
# PHP Service
php:
user: "${UID}:${GID}"
container_name: ${PROJECT_NAME}_php_${VERSION_ID}
build: ./docker/php
working_dir: /var/www/php
volumes:
- ./app:/var/www/php
- ./docker/php/php-adjustment.ini:/usr/local/etc/php/conf.d/php-adjustment.ini
environment:
APP_URL: ${APP_URL}
TIME_ZONE: ${TIME_ZONE}
version: "3.7"
services:
mysql-server:
image: mysql:8.0.19
restart: always
environment:
MYSQL_ROOT_PASSWORD: secret
volumes:
- mysql-data:/var/lib/mysql
ports:
- "3306:3306"
phpmyadmin:
image: phpmyadmin/phpmyadmin:5.0.1
restart: always
environment:
PMA_HOST: mysql-server
PMA_USER: root
PMA_PASSWORD: secret
ports:
- "8306:80"
volumes:
mysql-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment