File tree Expand file tree Collapse file tree 5 files changed +27
-8
lines changed Expand file tree Collapse file tree 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
23APP_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:
3131
3232Build the *** Docker Image*** without using *** cached*** versions of previous image build stages.
3333
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+
3438``` 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 .
3640```
3741
3842### Create A Container
3943
4044This 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.
4145
4246``` 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
4448```
4549
4650** OR**
4751
4852This 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***
4953
5054``` 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
5256```
5357
5458### Start Container
Original file line number Diff line number Diff line change 1- version : ' 3.4 '
1+ version : ' 3.7 '
22
33services :
44 php-5-6-web-server :
5+ container_name : php-5-6-web-server
6+ tty : true
7+ restart : unless-stopped
58 build :
69 context : .
10+ target : php-5-6-build
711 dockerfile : php-5-6-apache.Dockerfile
12+ args :
13+ - APP_ENV=${APP_ENV}
814 labels :
915 ewc.name : " Web Server"
1016 ewc.description : " PHP & Apache Web Server"
1117 ewc.php.version : " 5.6"
1218 ewc.label-with-empty-value : " "
1319 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
1525 ports :
1626 - ${APP_PORT}:80
1727 - ${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
22
33# Set some image labels
44LABEL evilwizardcreations.image.authors="evil.wizard95@googlemail.com" \
@@ -34,4 +34,4 @@ RUN pecl install yaml-1.3.0 && \
3434 docker-php-ext-enable yaml
3535
3636# 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