Skip to content

Commit 0777fd0

Browse files
Merge pull request #1 from 99linesofcode/extract-docker-base
Extract docker base containers to separate repository
2 parents d3bca8d + dd90e9b commit 0777fd0

4 files changed

Lines changed: 47 additions & 115 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "base"]
2+
path = base
3+
url = git@github.com:99linesofcode/docker-base.git

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Additionally, this repository contains a production ready FrankenPHP container t
1313

1414
Almost all the relevant configuration is done in/from the `docker-compose.yml` file. By default the devcontainer is disabled.
1515

16-
## Contributing to docker-base
16+
## Contributing to docker-php
1717

18-
Thank you for considering contributing to docker-base. Please review our [Contribution Guidelines](https://github.com/99linesofcode/.github/blob/main/.github/CONTRIBUTING.md).
18+
Thank you for considering contributing to docker-php. Please review our [Contribution Guidelines](https://github.com/99linesofcode/.github/blob/main/.github/CONTRIBUTING.md).
1919

2020
## Code of Conduct
2121

@@ -27,4 +27,4 @@ Please review [our security policy](https://github.com/99linesofcode/.github?tab
2727

2828
## License
2929

30-
docker-base is open-sourced software licensed under the [MIT license](https://github.com/99linesofcode/docker-base?tab=MIT-1-ov-file)
30+
docker-php is open-sourced software licensed under the [MIT license](https://github.com/99linesofcode/docker-php?tab=MIT-1-ov-file)

base

Submodule base added at 01366f8

docker-compose.yml

Lines changed: 40 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,4 @@
11
services:
2-
# devcontainer:
3-
# build:
4-
# context: .
5-
# dockerfile: docker/devcontainer/Dockerfile
6-
# # See https://docs.docker.com/compose/compose-file/build/#ssh
7-
# ssh:
8-
# - default # lets the builder connect to the default SSH agent
9-
# args:
10-
# - PUID=${PUID:-1000}
11-
# - PGID=${PGID:-1000}
12-
# - TZ=${TIMEZONE:-Europe/Amsterdam}
13-
# container_name: ${APP_NAME}-devcontainer
14-
# tty: true
15-
# environment:
16-
# - XDEBUG_MODE=${PHP_XDEBUG_MODE:-off}
17-
# - XDEBUG_CONFIG=${PHP_XDEBUG_CONFIG:-client_host=host.docker.internal output_dir=/tmp/xdebug profiler_output_name=cachegrind.out.%R.%u}
18-
# extra_hosts:
19-
# - "host.docker.internal:host-gateway" # for accessing the host from inside the container
20-
# depends_on:
21-
# - meilisearch
22-
# - mysql
23-
# - redis
24-
# volumes:
25-
# - $HOME/.ssh:/config/.ssh:ro # the SSH agent will need access to your configuration
26-
# - $HOME/.npmrc:/config/.npmrc # necessary when installing packages from a private repository
27-
# - $HOME/.config/composer/auth.json:/config/.config/composer/auth.json # necessary when installing packages from a private repository
28-
# - ../:/app
29-
# # - $HOME/Development/profiling/${APP_NAME}:/tmp/xdebug # mount xdebug and cachegrind output for profiling analysis on host machine
30-
312
# frankenphp: # PHP 8.2+
323
# build:
334
# context: .
@@ -39,22 +10,21 @@ services:
3910
# - meilisearch
4011
# - mysql
4112
# - redis
13+
# - soketi
4214
# volumes:
4315
# - .:/app
4416
# - $HOME/Development/profiling/${APP_NAME}:/tmp/xdebug # mount xdebug and cachegrind output for profiling analysis on host machine
4517

46-
soketi:
47-
container_name: ${APP_NAME}-soketi
48-
image: quay.io/soketi/soketi:latest
49-
environment:
50-
- SOKETI_DEBUG=${SOKETI_DEBUG:-1}
51-
- SOKETI_METRICS_SERVER_PORT=${SOKETI_METRICS_SERVER_PORT:-9601}
52-
- SOKETI_DEFAULT_APP_ID=${PUSHER_APP_ID}
53-
- SOKETI_DEFAULT_APP_KEY=${PUSHER_APP_KEY}
54-
- SOKETI_DEFAULT_APP_SECRET=${PUSHER_APP_SECRET}
18+
mailpit:
19+
container_name: ${APP_NAME}-mailpit
20+
image: axllent/mailpit:latest
5521
ports:
56-
- ${PUSHER_FRONTEND_PORT:-6001}:6001
57-
- ${PUSHER_METRICS_PORT:-9601}:9601
22+
- ${FORWARD_MAILPIT_PORT:-1025}:1025
23+
- ${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025
24+
healthcheck:
25+
test: ["CMD", "curl", "-Ss", "http://localhost:8025/livez"]
26+
retries: 3
27+
timeout: 5s
5828

5929
meilisearch:
6030
container_name: ${APP_NAME}-meilisearch
@@ -76,45 +46,12 @@ services:
7646
timeout: 5s
7747

7848
mysql:
79-
container_name: ${APP_NAME}-mysql
80-
image: mysql/mysql-server:8.0
81-
ports:
82-
- ${FORWARD_DB_PORT:-3306}:3306
83-
environment:
84-
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
85-
- MYSQL_ROOT_HOST=%
86-
- MYSQL_DATABASE=${DB_DATABASE}
87-
- MYSQL_USER=${DB_USERNAME}
88-
- MYSQL_PASSWORD=${DB_PASSWORD}
49+
extends:
50+
file: ./docker/base/docker-compose.yml
51+
service: mysql
8952
volumes:
9053
- mysql:/var/lib/mysql
91-
healthcheck:
92-
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
93-
retries: 3
94-
timeout: 5s
95-
96-
# FIXME: serve different urls for process.browser and SSR to avoid CORS issues when SSR
97-
# FIXME: dont volume mount /node_modules to drastically improve performance
98-
#
99-
# nodejs:
100-
# container_name: ${APP_NAME}-nodejs
101-
# image: node:alpine
102-
# user: node
103-
# working_dir: /var/www/html
104-
# extra_hosts:
105-
# - host.docker.internal:host-gateway
106-
# ports:
107-
# - ${FORWARD_NODE_PORT:-3000}:3000
108-
# - ${FORWARD_VITE_PORT:-24678}:24678
109-
# environment:
110-
# - NODE_ENV=${APP_ENV:-development}
111-
# - NUXT_HOST=nodejs
112-
# - NUXT_PORT=${FORWARD_NODE_PORT:-3000}
113-
# volumes:
114-
# - ../nuxt:/var/www/html
115-
# command: npm run dev
116-
# depends_on: # NOTE: cannot be used when extending, extract to child
117-
# - php
54+
# - $HOME/dbdump.sql:/docker-entrypoint-initdb.d/dbdump.sql # dbdump.sql is read on init and can be used to prepopulate the db
11855

11956
nginx:
12057
image: lscr.io/linuxserver/nginx:1.26.3 # PHP 8.1
@@ -123,54 +60,45 @@ services:
12360
- PUID=${PUID:-1000}
12461
- PGID=${PGID:-1000}
12562
- TZ=${TIMEZONE:-Europe/Amsterdam}
63+
depends_on:
64+
- meilisearch
65+
- mysql
66+
- redis
67+
- soketi
12668
volumes:
12769
- $HOME/.config/${APP_NAME}:/config
128-
- $HOME/Development/Leren voor Morgen/mbo.sustainabul.com:/app/www
70+
- .:/app/www
12971
ports:
13072
- 80:80
13173
- 443:443
13274
restart: unless-stopped
13375

76+
phpmyadmin:
77+
extends:
78+
file: ./docker/base/docker-compose.yml
79+
service: phpmyadmin
80+
depends_on:
81+
- mysql
82+
13483
redis:
135-
container_name: ${APP_NAME}-redis
136-
image: redis:alpine
137-
ports:
138-
- ${FORWARD_REDIS_PORT:-6379}:6379
84+
extends:
85+
file: ./docker/base/docker-compose.yml
86+
service: redis
13987
volumes:
14088
- redis:/data
141-
healthcheck:
142-
test: ["CMD", "redis-cli", "ping"]
143-
retries: 3
144-
timeout: 5s
14589

146-
phpmyadmin:
147-
image: phpmyadmin:latest
148-
container_name: ${APP_NAME}-phpmyadmin
90+
soketi:
91+
container_name: ${APP_NAME}-soketi
92+
image: quay.io/soketi/soketi:latest
14993
environment:
150-
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
151-
- MYSQL_USER=${DB_USERNAME}
152-
- MYSQL_PASSWORD=${DB_PASSWORD}
153-
- PMA_HOST=${APP_NAME}-mysql
154-
- PMA_PMADB=phpmyadmin
155-
- UPLOAD_LIMIT=512M
156-
restart: unless-stopped
157-
ports:
158-
- ${PHPMYADMIN_PORT:-8888}:80
159-
healthcheck:
160-
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
161-
retries: 3
162-
timeout: 5s
163-
164-
mailpit:
165-
container_name: ${APP_NAME}-mailpit
166-
image: axllent/mailpit:latest
94+
- SOKETI_DEBUG=${SOKETI_DEBUG:-1}
95+
- SOKETI_METRICS_SERVER_PORT=${SOKETI_METRICS_SERVER_PORT:-9601}
96+
- SOKETI_DEFAULT_APP_ID=${PUSHER_APP_ID}
97+
- SOKETI_DEFAULT_APP_KEY=${PUSHER_APP_KEY}
98+
- SOKETI_DEFAULT_APP_SECRET=${PUSHER_APP_SECRET}
16799
ports:
168-
- ${FORWARD_MAILPIT_PORT:-1025}:1025
169-
- ${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025
170-
healthcheck:
171-
test: ["CMD", "curl", "-Ss", "http://localhost:8025/livez"]
172-
retries: 3
173-
timeout: 5s
100+
- ${PUSHER_FRONTEND_PORT:-6001}:6001
101+
- ${PUSHER_METRICS_PORT:-9601}:9601
174102

175103
# webgrind:
176104
# container_name: ${APP_NAME}-webgrind

0 commit comments

Comments
 (0)