Skip to content

Commit c645d25

Browse files
committed
build: add DDEV config
1 parent f0487c7 commit c645d25

File tree

2 files changed

+294
-0
lines changed

2 files changed

+294
-0
lines changed

.ddev/config.yaml

+284
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
name: php-http-fixture-client
2+
type: php
3+
docroot: ""
4+
php_version: "8.3"
5+
webserver_type: nginx-fpm
6+
router_http_port: "80"
7+
router_https_port: "443"
8+
xdebug_enabled: false
9+
additional_hostnames: []
10+
additional_fqdns: []
11+
database:
12+
type: mariadb
13+
version: "10.4"
14+
omit_containers: [db, ddev-ssh-agent]
15+
use_dns_when_possible: true
16+
composer_version: "2"
17+
web_environment: []
18+
nodejs_version: "20"
19+
web_extra_exposed_ports:
20+
- name: vite
21+
container_port: 5173
22+
http_port: 5172
23+
https_port: 5173
24+
25+
# Key features of DDEV's config.yaml:
26+
27+
# name: <projectname> # Name of the project, automatically provides
28+
# http://projectname.ddev.site and https://projectname.ddev.site
29+
30+
# type: <projecttype> # backdrop, craftcms, django4, drupal6/7/8/9/10, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
31+
# See https://ddev.readthedocs.io/en/latest/users/quickstart/ for more
32+
# information on the different project types
33+
34+
# docroot: <relative_path> # Relative path to the directory containing index.php.
35+
36+
# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"
37+
38+
# You can explicitly specify the webimage but this
39+
# is not recommended, as the images are often closely tied to DDEV's' behavior,
40+
# so this can break upgrades.
41+
42+
# webimage: <docker_image> # nginx/php docker image.
43+
44+
# database:
45+
# type: <dbtype> # mysql, mariadb, postgres
46+
# version: <version> # database version, like "10.4" or "8.0"
47+
# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0
48+
# PostgreSQL versions can be 9-16.
49+
50+
# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
51+
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
52+
53+
# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart"
54+
# Note that for most people the commands
55+
# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better,
56+
# as leaving Xdebug enabled all the time is a big performance hit.
57+
58+
# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart"
59+
# Note that for most people the commands
60+
# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better,
61+
# as leaving Xhprof enabled all the time is a big performance hit.
62+
63+
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
64+
65+
# timezone: Europe/Berlin
66+
# This is the timezone used in the containers and by PHP;
67+
# it can be set to any valid timezone,
68+
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
69+
# For example Europe/Dublin or MST7MDT
70+
71+
# composer_root: <relative_path>
72+
# Relative path to the Composer root directory from the project root. This is
73+
# the directory which contains the composer.json and where all Composer related
74+
# commands are executed.
75+
76+
# composer_version: "2"
77+
# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1
78+
# to use the latest major version available at the time your container is built.
79+
# It is also possible to use each other Composer version channel. This includes:
80+
# - 2.2 (latest Composer LTS version)
81+
# - stable
82+
# - preview
83+
# - snapshot
84+
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
85+
# To reinstall Composer after the image was built, run "ddev debug refresh".
86+
87+
# nodejs_version: "18"
88+
# change from the default system Node.js version to any other version.
89+
# Numeric version numbers can be complete (i.e. 18.15.0) or
90+
# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with
91+
# other named releases.
92+
# see https://www.npmjs.com/package/n#specifying-nodejs-versions
93+
# Note that you can continue using 'ddev nvm' or nvm inside the web container
94+
# to change the project's installed node version if you need to.
95+
96+
# additional_hostnames:
97+
# - somename
98+
# - someothername
99+
# would provide http and https URLs for "somename.ddev.site"
100+
# and "someothername.ddev.site".
101+
102+
# additional_fqdns:
103+
# - example.com
104+
# - sub1.example.com
105+
# would provide http and https URLs for "example.com" and "sub1.example.com"
106+
# Please take care with this because it can cause great confusion.
107+
108+
# upload_dirs: "custom/upload/dir"
109+
#
110+
# upload_dirs:
111+
# - custom/upload/dir
112+
# - ../private
113+
#
114+
# would set the destination paths for ddev import-files to <docroot>/custom/upload/dir
115+
# When Mutagen is enabled this path is bind-mounted so that all the files
116+
# in the upload_dirs don't have to be synced into Mutagen.
117+
118+
# disable_upload_dirs_warning: false
119+
# If true, turns off the normal warning that says
120+
# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set"
121+
122+
# ddev_version_constraint: ""
123+
# Example:
124+
# ddev_version_constraint: ">= 1.22.4"
125+
# This will enforce that the running ddev version is within this constraint.
126+
# See https://github.com/Masterminds/semver#checking-version-constraints for
127+
# supported constraint formats
128+
129+
# working_dir:
130+
# web: /var/www/html
131+
# db: /home
132+
# would set the default working directory for the web and db services.
133+
# These values specify the destination directory for ddev ssh and the
134+
# directory in which commands passed into ddev exec are run.
135+
136+
# omit_containers: [db, ddev-ssh-agent]
137+
# Currently only these containers are supported. Some containers can also be
138+
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
139+
# the "db" container, several standard features of DDEV that access the
140+
# database container will be unusable. In the global configuration it is also
141+
# possible to omit ddev-router, but not here.
142+
143+
# performance_mode: "global"
144+
# DDEV offers performance optimization strategies to improve the filesystem
145+
# performance depending on your host system. Should be configured globally.
146+
#
147+
# If set, will override the global config. Possible values are:
148+
# - "global": uses the value from the global config.
149+
# - "none": disables performance optimization for this project.
150+
# - "mutagen": enables Mutagen for this project.
151+
# - "nfs": enables NFS for this project.
152+
#
153+
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs
154+
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen
155+
156+
# fail_on_hook_fail: False
157+
# Decide whether 'ddev start' should be interrupted by a failing hook
158+
159+
# host_https_port: "59002"
160+
# The host port binding for https can be explicitly specified. It is
161+
# dynamic unless otherwise specified.
162+
# This is not used by most people, most people use the *router* instead
163+
# of the localhost port.
164+
165+
# host_webserver_port: "59001"
166+
# The host port binding for the ddev-webserver can be explicitly specified. It is
167+
# dynamic unless otherwise specified.
168+
# This is not used by most people, most people use the *router* instead
169+
# of the localhost port.
170+
171+
# host_db_port: "59002"
172+
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
173+
# unless explicitly specified.
174+
175+
# mailpit_http_port: "8025"
176+
# mailpit_https_port: "8026"
177+
# The Mailpit ports can be changed from the default 8025 and 8026
178+
179+
# host_mailpit_port: "8025"
180+
# The mailpit port is not normally bound on the host at all, instead being routed
181+
# through ddev-router, but it can be bound directly to localhost if specified here.
182+
183+
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
184+
# Extra Debian packages that are needed in the webimage can be added here
185+
186+
# dbimage_extra_packages: [telnet,netcat]
187+
# Extra Debian packages that are needed in the dbimage can be added here
188+
189+
# use_dns_when_possible: true
190+
# If the host has internet access and the domain configured can
191+
# successfully be looked up, DNS will be used for hostname resolution
192+
# instead of editing /etc/hosts
193+
# Defaults to true
194+
195+
# project_tld: ddev.site
196+
# The top-level domain used for project URLs
197+
# The default "ddev.site" allows DNS lookup via a wildcard
198+
# If you prefer you can change this to "ddev.local" to preserve
199+
# pre-v1.9 behavior.
200+
201+
# ngrok_args: --basic-auth username:pass1234
202+
# Provide extra flags to the "ngrok http" command, see
203+
# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h"
204+
205+
# disable_settings_management: false
206+
# If true, DDEV will not create CMS-specific settings files like
207+
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
208+
# In this case the user must provide all such settings.
209+
210+
# You can inject environment variables into the web container with:
211+
# web_environment:
212+
# - SOMEENV=somevalue
213+
# - SOMEOTHERENV=someothervalue
214+
215+
# no_project_mount: false
216+
# (Experimental) If true, DDEV will not mount the project into the web container;
217+
# the user is responsible for mounting it manually or via a script.
218+
# This is to enable experimentation with alternate file mounting strategies.
219+
# For advanced users only!
220+
221+
# bind_all_interfaces: false
222+
# If true, host ports will be bound on all network interfaces,
223+
# not the localhost interface only. This means that ports
224+
# will be available on the local network if the host firewall
225+
# allows it.
226+
227+
# default_container_timeout: 120
228+
# The default time that DDEV waits for all containers to become ready can be increased from
229+
# the default 120. This helps in importing huge databases, for example.
230+
231+
#web_extra_exposed_ports:
232+
#- name: nodejs
233+
# container_port: 3000
234+
# http_port: 2999
235+
# https_port: 3000
236+
#- name: something
237+
# container_port: 4000
238+
# https_port: 4000
239+
# http_port: 3999
240+
# Allows a set of extra ports to be exposed via ddev-router
241+
# Fill in all three fields even if you don’t intend to use the https_port!
242+
# If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start.
243+
#
244+
# The port behavior on the ddev-webserver must be arranged separately, for example
245+
# using web_extra_daemons.
246+
# For example, with a web app on port 3000 inside the container, this config would
247+
# expose that web app on https://<project>.ddev.site:9999 and http://<project>.ddev.site:9998
248+
# web_extra_exposed_ports:
249+
# - name: myapp
250+
# container_port: 3000
251+
# http_port: 9998
252+
# https_port: 9999
253+
254+
#web_extra_daemons:
255+
#- name: "http-1"
256+
# command: "/var/www/html/node_modules/.bin/http-server -p 3000"
257+
# directory: /var/www/html
258+
#- name: "http-2"
259+
# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000"
260+
# directory: /var/www/html
261+
262+
# override_config: false
263+
# By default, config.*.yaml files are *merged* into the configuration
264+
# But this means that some things can't be overridden
265+
# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge
266+
# and you can't erase existing hooks or all environment variables.
267+
# However, with "override_config: true" in a particular config.*.yaml file,
268+
# 'use_dns_when_possible: false' can override the existing values, and
269+
# hooks:
270+
# post-start: []
271+
# or
272+
# web_environment: []
273+
# or
274+
# additional_hostnames: []
275+
# can have their intended affect. 'override_config' affects only behavior of the
276+
# config.*.yaml file it exists in.
277+
278+
# Many DDEV commands can be extended to run tasks before or after the
279+
# DDEV command is executed, for example "post-start", "post-import-db",
280+
# "pre-composer", "post-composer"
281+
# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more
282+
# information on the commands that can be extended and the tasks you can define
283+
# for them. Example:
284+
#hooks:

docs/.vitepress/config.js

+10
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,15 @@ export default defineConfig({
77
themeConfig: {
88
repo: 'swisnl/php-http-fixture-client',
99
editLinks: false,
10+
},
11+
vite: {
12+
server: process.env.IS_DDEV_PROJECT ? {
13+
strictPort: true,
14+
host: true,
15+
hmr: {
16+
host: process.env.DDEV_HOSTNAME.split(',')[0],
17+
protocol: 'wss',
18+
}
19+
} : {},
1020
}
1121
})

0 commit comments

Comments
 (0)