-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (46 loc) · 2.22 KB
/
docker-compose.yml
File metadata and controls
46 lines (46 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
version: "3"
# Defines which compose version to use
services:
# Services line define which Docker images to run. In this case, it will be MySQL server and WordPress image.
db:
image: mysql:5.7
# image: mysql:5.7 indicates the MySQL database container image from Docker Hub used in this installation.
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: interlucid-website
MYSQL_USER: interlucid
MYSQL_PASSWORD: password
# Previous four lines define the main variables needed for the MySQL container to work: database, database username, database user password, and the MySQL root password.
ports:
- "3305:3306"
wordpress:
depends_on:
- db
image: wordpress:latest
restart: always
# Restart line controls the restart mode, meaning if the container stops running for any reason, it will restart the process immediately.
ports:
- "8080:8080"
# The previous line defines the port that the WordPress container will use. After successful installation, the full path will look like this: http://localhost:8000
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: interlucid
WORDPRESS_DB_PASSWORD: password
WORDPRESS_DB_NAME: interlucid-website
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://localhost:8080');
define('WP_SITEURL', 'http://localhost:8080');
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
ini_set('log_errors', 1);
ini_set('error_log', '/var/www/html/wp-content/debug.log');
ini_set('error_log', '/var/www/html/wp-content/debug.log');
ini_set('memory_limit', '512M');
ini_set('max_execution_time', 300);
# Similar to MySQL image variables, the last four lines define the main variables needed for the WordPress container to work properly with the MySQL container.
volumes:
- ./:/var/www/html
- ./000-default.conf:/etc/apache2/sites-available/000-default.conf
volumes:
mysql: {}