This repository was archived by the owner on Nov 4, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +150
-0
lines changed Expand file tree Collapse file tree 6 files changed +150
-0
lines changed Original file line number Diff line number Diff line change 2121 matrix :
2222 context :
2323 - all-in-one
24+ - nginx
25+ - php
2426
2527 steps :
2628 - name : Checkout repository
Original file line number Diff line number Diff line change 1+ name : WordPress
2+
3+ networks :
4+ wordpress :
5+ driver : bridge
6+
7+ volumes :
8+ db_data : {}
9+ wordpress_data : {}
10+
11+ services :
12+ db :
13+ image : mariadb:lts
14+ volumes :
15+ - db_data:/var/lib/mysql
16+ restart : always
17+ environment :
18+ MYSQL_ROOT_PASSWORD : somewordpress
19+ MYSQL_DATABASE : wordpress
20+ MYSQL_USER : wordpress
21+ MYSQL_PASSWORD : wordpress
22+ networks :
23+ - wordpress
24+
25+ nginx :
26+ build :
27+ context : nginx
28+ depends_on :
29+ - php
30+ ports :
31+ - " 8080:80"
32+ networks :
33+ - wordpress
34+ volumes :
35+ - wordpress_data:/var/www/html/wp-content
36+
37+ php :
38+ build :
39+ context : php
40+ depends_on :
41+ - db
42+ networks :
43+ - wordpress
44+ volumes :
45+ - wordpress_data:/var/www/html/wp-content
Original file line number Diff line number Diff line change 1+ ARG NGINX_VERSION=1.26.2
2+ FROM nginx:${NGINX_VERSION}-alpine
3+
4+ # Install nginx
5+ RUN mkdir -p /etc/nginx/snippets
6+ COPY fastcgi-php.conf /etc/nginx/snippets/fastcgi-php.conf
7+ COPY default.conf /etc/nginx/conf.d/default.conf
8+
9+ WORKDIR /var/www/html
10+
11+ # Download WordPress
12+ ARG WORDPRESS_VERSION=latest
13+ RUN curl -o /tmp/wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"
14+ RUN tar -xzf /tmp/wordpress.tar.gz -C /var/www/html --strip-components=1
15+ RUN rm -f /tmp/wordpress.tar.gz
16+ RUN chmod -R 755 /var/www/html
17+ RUN chown -R nginx:nginx /var/www/html
18+
19+ EXPOSE 80
20+
21+ ENTRYPOINT ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change 1+ upstream php {
2+ server php:9000;
3+ }
4+
5+ server {
6+ listen 80;
7+ server_name localhost;
8+ root /var/www/html;
9+
10+ index index.php index.html index.htm;
11+
12+ # Access log
13+ access_log /var/log/nginx/access.log;
14+ error_log /var/log/nginx/error.log;
15+
16+ location = /favicon.ico {
17+ log_not_found off;
18+ access_log off;
19+ }
20+
21+ location = /robots.txt {
22+ allow all;
23+ log_not_found off;
24+ access_log off;
25+ }
26+
27+ location / {
28+ # This is cool because no php is touched for static content.
29+ # include the "?$args" part so non-default permalinks doesn't break when using query string
30+ try_files $uri $uri/ /index.php?$args;
31+ }
32+
33+ location /healthcheck {
34+ return 200 'healthy';
35+ }
36+
37+ # PHP-FPM configuration
38+ location ~ \.php$ {
39+ include snippets/fastcgi-php.conf;
40+ fastcgi_pass php;
41+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
42+ include fastcgi_params;
43+ }
44+
45+ # Deny access to .htaccess files, if Apache's document root
46+ # concurs with nginx's one
47+ location ~ /\.ht {
48+ deny all;
49+ }
50+ }
Original file line number Diff line number Diff line change 1+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
2+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3+ fastcgi_index index.php;
4+ include fastcgi_params;
Original file line number Diff line number Diff line change 1+ ARG PHP_VERSION=8.0
2+ FROM php:${PHP_VERSION}-fpm
3+
4+ # Install PHP extensions
5+ ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
6+ ARG PHP_EXTENSIONS="gd opcache zip pdo_mysql mysqli redis xdebug imagick exif mbstring zip"
7+ RUN install-php-extensions ${PHP_EXTENSIONS}
8+
9+ RUN echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/opcache.ini
10+ RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/opcache.ini
11+ RUN echo "opcache.memory_consumption=256" >> /usr/local/etc/php/conf.d/opcache.ini
12+ RUN echo "memory_limit=2048M" >> /usr/local/etc/php/conf.d/performance.ini
13+ RUN echo "upload_max_filesize=100M" >> /usr/local/etc/php/conf.d/performance.ini
14+ RUN echo "post_max_size=100M" >> /usr/local/etc/php/conf.d/performance.ini
15+
16+ # Download WordPress
17+ ARG WORDPRESS_VERSION=latest
18+ RUN curl -o /tmp/wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"
19+ RUN tar -xzf /tmp/wordpress.tar.gz -C /var/www/html --strip-components=1
20+ RUN rm -f /tmp/wordpress.tar.gz
21+ RUN chmod -R 755 /var/www/html
22+ RUN chown -R www-data:www-data /var/www/html
23+
24+ EXPOSE 9000
25+
26+ WORKDIR /var/www/html
27+
28+ ENTRYPOINT ["php-fpm" , "-F" ]
You can’t perform that action at this time.
0 commit comments