Skip to content

Commit da287cc

Browse files
authored
Merge pull request #2 from Stackmasters/issue-001-add-scaffolding
Add scaffolding
2 parents 2beee4c + c979b8a commit da287cc

File tree

5 files changed

+88
-0
lines changed

5 files changed

+88
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore system files
2+
.DS_Store
3+
Thumbs.db
4+
5+
# Ignore composer dependencies
6+
/vendor

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM php:8.2-fpm as php-fpm
2+
WORKDIR /var/www/html
3+
4+
COPY ./ ./
5+
6+
FROM nginx:1.25 as nginx
7+
COPY ./nginx.conf /etc/nginx/nginx.conf
8+
9+
FROM mysql:8.0 as mysql

docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: "3.8"
2+
3+
services:
4+
php-fpm:
5+
build:
6+
context: .
7+
target: php-fpm
8+
image: cycleops/php-demo:php-fpm
9+
ports:
10+
- 9000:9000
11+
volumes:
12+
- ./www/html/:/var/www/html/
13+
14+
nginx:
15+
build:
16+
context: .
17+
target: nginx
18+
image: cycleops/php-demo:nginx
19+
ports:
20+
- 80:80
21+
volumes:
22+
- ./nginx.conf:/etc/nginx/nginx.conf
23+
- ./www/html/:/var/www/html/
24+
restart: on-failure
25+
26+
mysql:
27+
image: mysql:8.0
28+
volumes:
29+
- mysql_data:/var/lib/mysql
30+
environment:
31+
MYSQL_ROOT_PASSWORD: rootpassword
32+
MYSQL_DATABASE: mydatabase
33+
MYSQL_USER: myuser
34+
MYSQL_PASSWORD: mypassword
35+
36+
volumes:
37+
mysql_data:

nginx.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
worker_processes 1;
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
server {
9+
listen 80;
10+
server_name localhost;
11+
root /var/www/html;
12+
13+
index index.php index.html index.htm;
14+
15+
location / {
16+
try_files $uri $uri/ /index.php?$query_string;
17+
}
18+
19+
location ~ \.php$ {
20+
include fastcgi_params;
21+
fastcgi_intercept_errors on;
22+
fastcgi_pass php-fpm:9000;
23+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24+
}
25+
}
26+
}
27+

www/html/index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<head>
3+
<title>Cycleops</title>
4+
</head>
5+
6+
<body>
7+
<h1>Welcome to Cycleops</h1>
8+
<p><?php echo 'We are running PHP, version: ' . phpversion(); ?></p>
9+
</body>

0 commit comments

Comments
 (0)