Last active
November 20, 2021 16:05
-
-
Save josfaber/01ec25193e33976fe7494ce15d98f06d to your computer and use it in GitHub Desktop.
Docker compose for custom Wordpress image and MySQL database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.1' | |
| services: | |
| wp: | |
| container_name: wordpress | |
| build: . | |
| ports: | |
| - 8080:80 | |
| restart: always | |
| environment: | |
| IS_DOCKER: 'true' | |
| WORDPRESS_DB_HOST: db | |
| WORDPRESS_DB_USER: user1 | |
| WORDPRESS_DB_PASSWORD: password1 | |
| WORDPRESS_DB_NAME: database1 | |
| WORDPRESS_TABLE_PREFIX: wp_ | |
| depends_on: | |
| - db | |
| links: | |
| - db:mysql | |
| volumes: | |
| - ./public:/var/www/html | |
| - ./env:/mnt/env | |
| db: | |
| container_name: mysql | |
| image: mysql:5.7 | |
| restart: always | |
| ports: | |
| - "3307:3306" | |
| environment: | |
| MYSQL_DATABASE: database1 | |
| MYSQL_USER: user1 | |
| MYSQL_PASSWORD: password1 | |
| MYSQL_ROOT_PASSWORD: letmein | |
| volumes: | |
| - ./db:/var/lib/mysql | |
| volumes: | |
| wordpress: | |
| db: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment