Skip to content

Commit 3d4ea3b

Browse files
committed
Initial commit
0 parents  commit 3d4ea3b

File tree

5 files changed

+91
-0
lines changed

5 files changed

+91
-0
lines changed

.env

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DB_CONNECTION=mysql
2+
DB_HOST=mysql
3+
DB_PORT=3306
4+
DB_DATABASE=database
5+
DB_USERNAME=username
6+
DB_PASSWORD=password

Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM phpdockerio/php74-fpm:latest
2+
3+
COPY . /application
4+
5+
WORKDIR /application
6+
# Fix debconf warnings upon build
7+
8+
ARG DEBIAN_FRONTEND=noninteractive
9+
10+
# Install selected extensions and other stuff
11+
RUN apt-get update \
12+
&& apt-get -y --no-install-recommends install php7.4-mysql \
13+
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
14+
15+
# Install git
16+
RUN apt-get update \
17+
&& apt-get -y install git \
18+
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
19+
20+
CMD ["/usr/sbin/php-fpm7.4", "-F"]
21+
22+
EXPOSE 8080

docker-compose.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: "3.1"
2+
services:
3+
4+
mysql:
5+
image: mysql:5.7
6+
container_name: mysql
7+
working_dir: /application
8+
volumes:
9+
- .:/application
10+
environment:
11+
MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
12+
MYSQL_DATABASE: "${DB_DATABASE}"
13+
MYSQL_USER: "${DB_USERNAME}"
14+
MYSQL_PASSWORD: "${DB_PASSWORD}"
15+
MYSQL_ROOT_HOST: "%"
16+
ports:
17+
- "${DB_PORT}:3306"
18+
19+
webserver:
20+
image: nginx:alpine
21+
container_name: webserver
22+
working_dir: /application
23+
volumes:
24+
- .:/application
25+
- ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
26+
ports:
27+
- "8080:80"
28+
29+
php-fpm:
30+
build: ./
31+
container_name: php-fpm
32+
working_dir: /application
33+
volumes:
34+
- .:/application
35+
- ./docker/php-fpm/php-ini-overrides.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini

docker/nginx/nginx.conf

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
server {
2+
listen 80 default;
3+
4+
client_max_body_size 308M;
5+
6+
access_log /var/log/nginx/application.access.log;
7+
8+
9+
root /application/public;
10+
index index.php;
11+
12+
if (!-e $request_filename) {
13+
rewrite ^.*$ /index.php last;
14+
}
15+
16+
location ~ \.php$ {
17+
fastcgi_pass php-fpm:9000;
18+
fastcgi_index index.php;
19+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
20+
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
21+
fastcgi_buffers 16 16k;
22+
fastcgi_buffer_size 32k;
23+
include fastcgi_params;
24+
}
25+
26+
}

docker/php-fpm/php-ini-overrides.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
upload_max_filesize = 100M
2+
post_max_size = 108M

0 commit comments

Comments
 (0)