https://github.com/takuya/docker-php-systemd
docker with systemd for LAMP
https://github.com/takuya/docker-php-systemd
Last synced: 5 months ago
JSON representation
docker with systemd for LAMP
- Host: GitHub
- URL: https://github.com/takuya/docker-php-systemd
- Owner: takuya
- License: agpl-3.0
- Created: 2021-07-12T09:37:12.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-13T05:50:34.000Z (almost 5 years ago)
- Last Synced: 2025-02-09T01:14:06.514Z (over 1 year ago)
- Language: Makefile
- Size: 18.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-php-systemd
docker container with systemd for LAMP
## LAMP
To run old php WebApp
## run
```shell
IMAGE=takuya/ubuntu-systemd-1804-modphp
mkdir data
data_dir=$(pwd)/data
PORT_PUBLISH=33400
NAME=myapp
docker run \
--name ${NAME}
-d \
--rm \
--privileged \
-v ${data_dir}/mysql:/var/lib/mysql \
-v ${data_dir}/web:/var/www/html \
-p ${PORT_PUBLISH}:80 \
${IMAGE}
```
## after startup
you must re-initialize mysql
` mysqld --initialized ` will be needed, when specify volume ` -v vol:/var/lib/mysql `.
```shell
NAME=myapp
docker exec -it $(docker ps -q --filter name=$NAME) mysqld --initialize
docker exec -it $(docker ps -q --filter name=$NAME) cat /var/log/mysql/error.log | grep -i pass
docker exec -it $(docker ps -q --filter name=$NAME) systemctl start mysql
docker exec -it $(docker ps -q --filter name=$NAME) mysql -p
```
```sql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD';
```
## test php is running
```shell
docker exec -it $(docker ps -q --filter name=$NAME) chown www-data -R /var/www/html
docker exec -it $(docker ps -q --filter name=$NAME) echo "> /var/www/html/phpinfo.php
curl localhost:${PORT_PUBLISH}/phpinfo.php
```