Skip to content

Instantly share code, notes, and snippets.

@rochamarcelo
Created July 31, 2023 17:26
Show Gist options
  • Save rochamarcelo/dfaa5fb1396b91f26425b916cdac4b53 to your computer and use it in GitHub Desktop.
Save rochamarcelo/dfaa5fb1396b91f26425b916cdac4b53 to your computer and use it in GitHub Desktop.
docker-compose php-7-with-mysql
version: "3.1"
services:
mysql:
image: mysql:5.7
container_name: oneprojectday-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=my_app
- MYSQL_USER=my_app
- MYSQL_PASSWORD=secret
command: mysqld --sql_mode="NO_ENGINE_SUBSTITUTION" --character-set-server=utf8 --collation-server=utf8_general_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
ports:
- "3306:3306"
php-fpm:
image: webdevops/php-nginx:7.4
container_name: oneprojectday-webserver
working_dir: /app
volumes:
- ./11-tasks/:/app
environment:
- WEB_DOCUMENT_ROOT=/app/webroot
- DATABASE_URL=mysql://my_app:secret@mysql/my_app?encoding=utf8&timezone=UTC&cacheMetadata=true
ports:
- "80:80"
- "443:443"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment