Skip to content

Commit 4a7e924

Browse files
committed
tested to run from documentation
1 parent 3191922 commit 4a7e924

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

.env-example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_ENV=local
2-
APP_PORT=8082
2+
APP_PORT=8080
33
APP_PORT_SSL=8043

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.env
2+
.env.backup
3+
.env.production
4+
/.vscode

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@ Build the ***Docker Image*** without using ***cached*** versions of previous ima
3434

3535
**N.B.**
3636

37-
This ***requires*** that the file be named `Dockerfile` and nothing else.
37+
This ***requires*** that the file be named `Dockerfile` and nothing else unless specified with the `-f php-7-4-apache.Dockerfile`.
3838

3939
```bash
40-
sudo docker build --target php-7-4-build --no-cache -t php-7-4-web-server .
40+
sudo docker build -f php-7-4-apache.Dockerfile --target php-7-4-build --no-cache -t php-7-4-web-server:latest .
4141
```
4242

4343
### Create A Container
4444

4545
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.
4646

4747
```bash
48-
sudo docker run -d --network host --name container-name php-7-4-web-server
48+
sudo docker run -d --network host -v "$(pwd)"/public_html:/var/www/html --name container-name php-7-4-web-server
4949
```
5050

5151
**OR**
5252

5353
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***
5454

5555
```bash
56-
sudo docker run -d --network bridge --expose 8080:80 --name container-name php-7-4-web-server
56+
sudo docker run -d --network bridge -p 8082:80/tcp -v "$(pwd)"/public_html:/var/www/html --name container-name php-7-4-web-server
5757
```
5858

5959
### Start Container

php-7-4-apache.Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ FROM php:7.4-apache as php-7-4-build
44
LABEL evilwizardcreations.image.authors="[email protected]" \
55
evilwizardcreations.image.php.version="7.4"
66

7-
# Enable some apache modules.
8-
RUN a2enmod rewrite; \
9-
a2enmod headers; \
10-
a2enmod ssl
7+
# copy the specific Composer PHAR version from the Composer image into the PHP image
8+
COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
119

1210
# Download the nodejs setup & set that it's a docker env.
1311
ENV NODE_ENV docker
1412
RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash
1513

14+
# Enable some apache modules.
15+
RUN a2enmod rewrite; \
16+
a2enmod headers; \
17+
a2enmod ssl
18+
1619
# Install some extra stuff
1720
RUN set -ex; \
1821
apt-get update; \
@@ -32,6 +35,3 @@ RUN set -ex; \
3235
RUN docker-php-ext-install gettext mysqli pdo_mysql zip
3336
RUN pecl install yaml && \
3437
docker-php-ext-enable yaml
35-
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

0 commit comments

Comments
 (0)