docker-compose.yml
· 1.1 KiB · YAML
Raw
services:
wordpress:
image: wordpress:latest
container_name: wordpress
healthcheck:
test: curl -f http://localhost:80/ || exit 1
# ports:
# - 8000:80
depends_on:
# mysql:
# condition: service_started
redis:
condition: service_healthy
# phpmyadmin:
# condition: service_started
volumes:
- /home/debian/wordpress:/var/www/html:rw
- /home/debian/wordpress/upload.ini:/usr/local/etc/php/conf.d/uploads.ini:rw
environment:
WORDPRESS_DB_HOST: mysql #name container mysql
WORDPRESS_DB_USER: your_user
WORDPRESS_DB_PASSWORD: your_password
WORDPRESS_DB_NAME: name_databas
networks:
- npm-internal
restart: unless-stopped
redis:
image: redis:latest
container_name: redis
user: 1000:1000
healthcheck:
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
volumes:
- /home/debian/wordpress/redis:/data:rw
environment:
TZ: Europe/Rome
networks:
- npm-internal
restart: unless-stopped
networks:
npm-internal:
name: npm-internal
external: true
1 | services: |
2 | wordpress: |
3 | image: wordpress:latest |
4 | container_name: wordpress |
5 | healthcheck: |
6 | test: curl -f http://localhost:80/ || exit 1 |
7 | # ports: |
8 | # - 8000:80 |
9 | depends_on: |
10 | # mysql: |
11 | # condition: service_started |
12 | redis: |
13 | condition: service_healthy |
14 | # phpmyadmin: |
15 | # condition: service_started |
16 | volumes: |
17 | - /home/debian/wordpress:/var/www/html:rw |
18 | - /home/debian/wordpress/upload.ini:/usr/local/etc/php/conf.d/uploads.ini:rw |
19 | environment: |
20 | WORDPRESS_DB_HOST: mysql #name container mysql |
21 | WORDPRESS_DB_USER: your_user |
22 | WORDPRESS_DB_PASSWORD: your_password |
23 | WORDPRESS_DB_NAME: name_databas |
24 | networks: |
25 | - npm-internal |
26 | restart: unless-stopped |
27 | redis: |
28 | image: redis:latest |
29 | container_name: redis |
30 | user: 1000:1000 |
31 | healthcheck: |
32 | test: ["CMD-SHELL", "redis-cli ping || exit 1"] |
33 | volumes: |
34 | - /home/debian/wordpress/redis:/data:rw |
35 | environment: |
36 | TZ: Europe/Rome |
37 | networks: |
38 | - npm-internal |
39 | restart: unless-stopped |
40 | |
41 | networks: |
42 | npm-internal: |
43 | name: npm-internal |
44 | external: true |
45 |