-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·126 lines (114 loc) · 3.63 KB
/
docker-compose.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.7'
# networks:
# wordpress:
# ipam:
# config:
# - subnet: 172.25.0.0/16
services:
# Nginx
# Load balance && reverse proxy for woocommerce by pass cross origin.
# nginx:
# build: ./nginx
# ports:
# - "5000:80"
# depends_on:
# - nuxtpress.front
# - nuxtpress.wp
# networks:
# - wpsite
# Database
nuxtpress.mysql:
container_name: ${NUXTPRESS_MYSQL_CONTAINER:-nuxtpress.mysql}
image: mysql:5.7
restart: always
volumes:
- ./db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${NUXTPRESS_MYSQL_ROOT_PASSWORD:-password}
MYSQL_DATABASE: ${NUXTPRESS_DB_NAME:-wordpress}
MYSQL_USER: ${NUXTPRESS_MYSQL_USER:-xwordpress}
MYSQL_PASSWORD: ${NUXTPRESS_MYSQL_PASSWORD:-xwordpress}
## if switch to just using .env file
# env_file:
# - ./env/db.env
networks:
- wpsite
# phpmyadmin
nuxtpress.phpmyadmin:
container_name: ${NUXTPRESS_PHPMYADMIN_CONTAINER:-nuxtpress.phpmyadmin}
image: phpmyadmin/phpmyadmin
restart: always
depends_on:
- nuxtpress.mysql
ports:
- '8080:80'
environment:
PMA_HOST: ${NUXTPRESS_MYSQL_CONTAINER:-nuxtpress.mysql}
MYSQL_ROOT_PASSWORD: ${NUXTPRESS_MYSQL_ROOT_PASSWORD:-password}
networks:
- wpsite
#Wordpress - Dockerfile BUILD
nuxtpress.wp:
container_name: ${NUXTPRESS_WP_CONTAINER:-nuxtpress.wp}
build:
context: ./backend
dockerfile: docker/Dockerfile
depends_on:
- ${NUXTPRESS_MYSQL_CONTAINER:-nuxtpress.mysql}
ports:
- '${NUXTPRESS_WP_PORT:-3080}:80'
restart: always
volumes:
- ./backend/wp-content:/var/www/html/wp-content
environment:
NUXTPRESS_WP_PORT: ${NUXTPRESS_WP_PORT:-3080}
WORDPRESS_DB_HOST: ${NUXTPRESS_DB_HOST:-nuxtpress.mysql:3306}
WORDPRESS_DB_USER: ${NUXTPRESS_DB_USER:-xwordpress}
WORDPRESS_DB_PASSWORD: ${NUXTPRESS_DB_PASSWORD:-xwordpress}
WORDPRESS_DB_NAME: ${NUXTPRESS_DB_NAME:-wordpress}
WORDPRESS_TABLE_PREFIX: ${NUXTPRESS_TABLE_PREFIX:-wnp_}
WORDPRESS_DEBUG: ${NUXTPRESS_DEBUG:-1}
WORDPRESS_CONFIG_EXTRA: |
define( 'WP_HEADLESS_URL', '${NUXTPRESS_URL_FRONTEND:-http://localhost:3000}' );
define( 'WP_SITEURL', 'http://localhost:${NUXTPRESS_WP_PORT:-3080}' );
define( 'WP_HOME', 'http://localhost:${NUXTPRESS_WP_PORT:-3080}' );
define( 'DISALLOW_FILE_EDIT', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
/* Multisite */
define('WP_ALLOW_MULTISITE', true );
/* JWT Authentication */
define('JWT_AUTH_CORS_ENABLE', true);
define('JWT_AUTH_SECRET_KEY', 'secret');
include( ABSPATH . '.env.php' );
networks:
- wpsite
# Nuxt2
# This is turned off by default
# Nuxt spins up a development server much faster "npm run dev".
# Switch back on production ready
# Set Woocommerce key and secret on .env
# nuxtpress.front:
# container_name: ${NUXTPRESS_NUXT_CONTAINER:-nuxtpress.front}
# build:
# context: ./frontend
# dockerfile: docker/dev/Dockerfile
# depends_on:
# - nuxtpress.wp
# - nuxtpress.mysql
# environment:
# NUXTPRESS_WP_CONTAINER: ${NUXTPRESS_WP_CONTAINER:-nuxtpress.wp}
# NUXTPRESS_WP_URL: ${NUXTPRESS_WP_URL:-http://localhost:3080}
# NUXTPRESS_WP_PORT: ${NUXTPRESS_WP_PORT:-3080}
# WOOCOMMERCE_KEY: ${WOOCOMMERCE_KEY}
# WOOCOMMERCE_SECRET: ${WOOCOMMERCE_SECRET}
# restart: always
# command: bash -c "npm run dev"
# networks:
# - wpsite
networks:
wpsite:
volumes:
db_data:
wp-content:
.htaccess: