-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
128 lines (121 loc) · 4.5 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
128 lines (121 loc) · 4.5 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
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
127
128
# Docker Compose configuration for the Shopclass local development stack.
#
# npm run dev:build first run (builds the php-fpm image)
# npm run dev start
# npm run dev:down stop
# npm run dev:logs follow
#
# Named .dev, not docker-compose.yml, so the filename says which stack it is beside
# docker-compose.prod.yml. The npm scripts pass -f for you; to use plain
# `docker compose` instead, set COMPOSE_FILE in a .env — see .env.example.
#
# Then open http://localhost:8000 and run the installer with:
# Host = mariadb Database = shopclass User = shopclass Password = shopclass
#
# Every default here can be changed from .env; copy .env.example to start one.
#
# Public themes are NOT mounted from here. oc-content/themes is gitignored (each theme
# has its own repository), so a mount to a sibling checkout only resolves on the machine
# that has it — and everywhere else Docker creates an empty directory at the mount point,
# which the theme loader reads as a broken theme rather than an absent one. Put those in
# docker-compose.local.yml (gitignored) and add it to COMPOSE_FILE; .env.example shows
# the shape, including that a theme has to be mounted into both services.
#
# For a theme without a local checkout, install one into the running stack instead:
# docker compose exec php-fpm php oc-cli.php market:install storefront --type=theme
name: shopclass
services:
# PHP-FPM (the application runtime)
php-fpm:
build:
context: .
dockerfile: .docker/php-fpm/Dockerfile
args:
# Run the container's worker as your host user (defaults to 1000:1000).
# Set PUID/PGID in a .env file or the environment if yours differ.
PUID: ${PUID:-1000}
PGID: ${PGID:-1000}
container_name: shopclass-php-fpm
working_dir: /application
volumes:
- .:/application
# Alpine PHP keeps its config here, not /etc/php/<ver>/...
- ./.docker/php-fpm/php-ini-overrides.ini:/usr/local/etc/php/conf.d/99-overrides.ini
# No theme mounts here on purpose — see the note at the top of this file.
environment:
# Configure entirely from the environment: ignore any config.php on the
# bind mount and read the database settings from these variables.
- OSC_IGNORE_CONFIG_FILE=1
- DB_HOST=mariadb
- DB_NAME=${SHOPCLASS_DATABASE_NAME:-shopclass}
- DB_USER=${SHOPCLASS_DATABASE_USER:-shopclass}
- DB_PASSWORD=${SHOPCLASS_DATABASE_PASSWORD:-shopclass}
# Persistent object cache backed by the memcached service below.
- OSC_CACHE=memcached
- OSC_CACHE_HOST=memcached
- OSC_CACHE_PORT=11211
depends_on:
mariadb:
condition: service_healthy
memcached:
condition: service_started
command: php-fpm
# MariaDB database. Kept in step with the prod stack's `db` service by hand — the
# nine shared lines are not worth a third compose file and an `extends` indirection
# to carry them.
mariadb:
image: mariadb:11
container_name: shopclass-mariadb
volumes:
- db-data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 5s
retries: 20
environment:
- MARIADB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
- MARIADB_DATABASE=${SHOPCLASS_DATABASE_NAME:-shopclass}
- MARIADB_USER=${SHOPCLASS_DATABASE_USER:-shopclass}
- MARIADB_PASSWORD=${SHOPCLASS_DATABASE_PASSWORD:-shopclass}
ports:
# Reach the database from the host (e.g. a GUI client) at 127.0.0.1:3307.
- "3307:3306"
# Memcached (optional object cache)
memcached:
image: memcached:alpine
container_name: shopclass-memcached
# Nginx web server
webserver:
image: nginx:alpine
container_name: shopclass-webserver
working_dir: /application
volumes:
- .:/application
- ./.docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php-fpm
ports:
- "8000:80"
# Mailhog — catches every outgoing e-mail so you can read it in a browser
mailhog:
image: mailhog/mailhog:latest
container_name: shopclass-mailhog
ports:
- "8025:8025"
# phpMyAdmin — database UI
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: shopclass-phpmyadmin
depends_on:
mariadb:
condition: service_healthy
ports:
- "8081:80"
environment:
- PMA_HOST=mariadb
- PMA_USER=root
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
# persistent volumes
volumes:
db-data: