File tree 5 files changed +27
-8
lines changed
5 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 1
- APP_PORT=8082
1
+ APP_ENV=local
2
+ APP_PORT=8080
2
3
APP_PORT_SSL=8043
Original file line number Diff line number Diff line change
1
+ .env
2
+ .env.backup
3
+ .env.production
4
+ /.vscode
Original file line number Diff line number Diff line change @@ -31,24 +31,28 @@ PHP Extensions:
31
31
32
32
Build the *** Docker Image*** without using *** cached*** versions of previous image build stages.
33
33
34
+ ** N.B.**
35
+
36
+ This *** requires*** that the file be named ` Dockerfile ` and nothing else unless specified with the ` -f php-5-6-apache.Dockerfile ` .
37
+
34
38
``` bash
35
- sudo docker build -- target build --no-cache -t php-5-6-web-server .
39
+ sudo docker build -f php-5-6-apache.Dockerfile -- target php-5-6- build --no-cache -t php-5-6-web-server:latest .
36
40
```
37
41
38
42
### Create A Container
39
43
40
44
This creates a named container and attaches it to the *** host network*** and may cause port conflict if the host machine is already listening on any exposed ports from the *** Docker Image*** being used.
41
45
42
46
``` bash
43
- sudo docker run -d --network host --name container-name php-5-6-web-server
47
+ sudo docker run -d --network host -v " $( pwd ) " /public_html:/var/www/html - -name container-name php-5-6-web-server
44
48
```
45
49
46
50
** OR**
47
51
48
52
This creates a named container and attaches it to the *** bridge network*** and allows for *** port forward mapping*** from the *** host*** to the *** Container*** . The ports are mapped ** 8080** on the *** Host*** machine to port ** 80** on the *** Container***
49
53
50
54
``` bash
51
- sudo docker run -d --network bridge --expose 8080:80 --name container-name php-5-6-web-server
55
+ sudo docker run -d --network bridge -p 8080:80/tcp -v " $( pwd ) " /public_html:/var/www/html --name container-name php-5-6-web-server
52
56
```
53
57
54
58
### Start Container
Original file line number Diff line number Diff line change 1
- version : ' 3.4 '
1
+ version : ' 3.7 '
2
2
3
3
services :
4
4
php-5-6-web-server :
5
+ container_name : php-5-6-web-server
6
+ tty : true
7
+ restart : unless-stopped
5
8
build :
6
9
context : .
10
+ target : php-5-6-build
7
11
dockerfile : php-5-6-apache.Dockerfile
12
+ args :
13
+ - APP_ENV=${APP_ENV}
8
14
labels :
9
15
ewc.name : " Web Server"
10
16
ewc.description : " PHP & Apache Web Server"
11
17
ewc.php.version : " 5.6"
12
18
ewc.label-with-empty-value : " "
13
19
image : ewc2020/web:php-5-6-apache
14
- container_name : php-5-6-web-server
20
+ environment :
21
+ - APP_ENV=${APP_ENV}
22
+ - APP_PORT=${APP_PORT}
23
+ - APP_PORT_SSL=${APP_PORT_SSL}
24
+ working_dir : /var/www
15
25
ports :
16
26
- ${APP_PORT}:80
17
27
- ${APP_PORT_SSL}:443
Original file line number Diff line number Diff line change 1
- FROM php:5.6-apache
1
+ FROM php:5.6-apache as php-5-6-build
2
2
3
3
# Set some image labels
4
4
LABEL evilwizardcreations.image.authors="evil.wizard95@googlemail.com" \
@@ -34,4 +34,4 @@ RUN pecl install yaml-1.3.0 && \
34
34
docker-php-ext-enable yaml
35
35
36
36
# copy the specific Composer PHAR version from the Composer image into the PHP image
37
- COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
37
+ COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
You can’t perform that action at this time.
0 commit comments