-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
61 lines (51 loc) · 2.23 KB
/
docker-compose.yml
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
version: '3.7'
services:
# Two services have at least to be defined: one for nginx and one for php-fpm. If something else is needed can be added.
web:
# Explicit tag to the nginx version used in production. It should be completely transparent to the application, so it
# could be changed if the necessity arises.
image: nginx:1.14.1
# Link the container to the network defined at the end of this file
networks:
- docknet
# Expose the port to the real world
ports:
- "80:80"
# Determine whic files are available inside the container
volumes:
# All the project on /var/www/html; this must be done also on PHP
- ./:/var/www/html
# Override the default nginx server definition with a custom one
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
# OPTIONAL: expose the nginx logs to the IDE
- ./var/log:/var/log/nginx
php:
# Choose here which PHP version you need. Ask some Sysadmin for a list of available images.
image: vengomatto/wyjenkinsslave:1.1-php7.2
# Link the container to the network defined at the end of this file
networks:
- docknet
# Launch the FPM executable keeping it on foreground, so Docker won't stop the container. The sudo is required because
# the image isn't meant to be run in this way.
command: "sudo php-fpm7.2 --nodaemonize"
# The images for Jenkins are not intended to be run in this way, so we need to create a directory; a temporary file system
# is quicker and more readeable than an hackish start command.
tmpfs:
- /run/php
# Determine whic files are available inside the container
volumes:
# All the project on /var/www/html; this must be done also on nginx
- ./:/var/www/html
# Override the default FPM pool configuration
- ./docker/php.conf:/etc/php/7.2/fpm/pool.d/www.conf
# Override the Xdebug configuration to enable debugging
- ./docker/xdebug.ini:/etc/php/7.2/mods-available/xdebug.ini
# OPTIONAL: expose the nginx logs to the IDE
- ./var/log:/var/log
networks:
# Define a network in bridge mode, with a strange subnet "just in case"
docknet:
driver: bridge
ipam:
config:
- subnet: 172.16.123.0/24