Skip to content

Commit af4e16b

Browse files
committed
right php version in compose & readme update
1 parent 028d8f5 commit af4e16b

File tree

2 files changed

+69
-5
lines changed

2 files changed

+69
-5
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,68 @@ PHP Extensions:
2727
- zip
2828
- yaml
2929

30+
## Build Image
31+
32+
Build the ***Docker Image*** without using ***cached*** versions of previous image build stages.
33+
34+
```bash
35+
sudo docker build --target build --no-cache -t php-5-6-web-server .
36+
```
37+
38+
### Create A Container
39+
40+
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+
42+
```bash
43+
sudo docker run -d --network host --name container-name php-5-6-web-server
44+
```
45+
46+
**OR**
47+
48+
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+
50+
```bash
51+
sudo docker run -d --network bridge --expose 8080:80 --name container-name php-5-6-web-server
52+
```
53+
54+
### Start Container
55+
56+
```bash
57+
sudo docker start php-5-6-web-server
58+
```
59+
60+
### Stop Container
61+
62+
```bash
63+
sudo docker stop php-5-6-web-server
64+
```
65+
66+
## Docker Compose
67+
68+
A `docker-compose` configuration file is included to simplify the build & deployment of the image.
69+
70+
### Build - No Cache
71+
72+
This is only necessary when completely rebuilding the image to make sure all parts are rebuilt[^compose_name_note].
73+
74+
```bash
75+
sudo docker-compose build --no-cache php-5-6-web-server
76+
```
77+
78+
### Build & Up
79+
80+
This will try to use a local version or rebuild the image with current context.
81+
82+
```bash
83+
sudo docker-compose up --build -d
84+
```
85+
86+
## Connect To Container
87+
88+
```bash
89+
sudo docker exec -it php-5-6-web-server /bin/bash
90+
```
91+
3092
[^docker_pull_cmd_note]: Use `docker pull ewc2020/web:php-5.6-apache` to get a copy of the image.
93+
94+
[^compose_name_note]: The `web-server` container name to build the image for.

docker-compose.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
version: '3.4'
22

33
services:
4-
web-server:
4+
php-5-6-web-server:
55
build:
66
context: .
7-
dockerfile: php-8-2-apache.Dockerfile
7+
dockerfile: php-5-6-apache.Dockerfile
88
labels:
99
ewc.name: "Web Server"
1010
ewc.description: "PHP & Apache Web Server"
11-
ewc.php.version: "8.2"
11+
ewc.php.version: "5.6"
1212
ewc.label-with-empty-value: ""
13-
image: ewc2020/web:php-8-2-apache
14-
container_name: web-server
13+
image: ewc2020/web:php-5-6-apache
14+
container_name: php-5-6-web-server
1515
ports:
1616
- ${APP_PORT}:80
1717
- ${APP_PORT_SSL}:443

0 commit comments

Comments
 (0)