-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (61 loc) · 1.76 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (61 loc) · 1.76 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
# Docker-based dev environment for the NFE.io PHP SDK.
#
# Quick start:
# cp .env.docker.example .env # one-time, sets UID/GID
# docker compose build # build all three matrix images
# docker compose run --rm php composer install
# docker compose run --rm php composer test
# docker compose run --rm php composer generate
#
# The `php` service is the primary one (PHP 8.2 — the project floor).
# Use `php83` and `php84` to reproduce the CI matrix locally:
# docker compose run --rm php83 composer test
# docker compose run --rm php84 composer test
x-php-defaults: &php-defaults
volumes:
- .:/app
- composer-cache:/home/app/.composer
working_dir: /app
init: true
tty: true
# Forward .env into the container so SDK env vars (NFEIO_API_KEY, NFEIO_COMPANY_ID,
# NFE_SDK_E2E, etc.) are available to PHP scripts running inside the container.
# The file is loaded at runtime (docker compose run/exec); build args still come
# from the host shell or `.env` interpolation in `args:`.
env_file:
- path: .env
required: false
services:
php:
<<: *php-defaults
build:
context: .
dockerfile: docker/Dockerfile
args:
PHP_VERSION: "8.2"
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: nfe-client-php:8.2
php83:
<<: *php-defaults
build:
context: .
dockerfile: docker/Dockerfile
args:
PHP_VERSION: "8.3"
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: nfe-client-php:8.3
php84:
<<: *php-defaults
build:
context: .
dockerfile: docker/Dockerfile
args:
PHP_VERSION: "8.4"
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: nfe-client-php:8.4
volumes:
composer-cache:
driver: local