Add docker compose config with Postgres

This commit is contained in:
Lewis Dale committed 2024-11-15 11:24:21 +00:00
1 parent 0372f86cd2
commit dc76405ba9
14 files changed
+135 -239

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
server {
listen 80 default_server;
root /var/www/html/public;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/error.log error;
sendfile off;
client_max_body_size 100m;
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 300;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /.ht {
deny all;
}
}
+24
View File
@@ -0,0 +1,24 @@
FROM composer:lts AS build
WORKDIR /var/www/html
COPY composer.json .
COPY composer.lock .
RUN --mount=type=bind,source=composer.json,target=composer.json \
--mount=type=bind,source=composer.lock,target=composer.lock \
--mount=type=cache,target=/tmp/cache \
composer install --no-dev --no-interaction
FROM php:8.3-fpm AS run
ARG DB_CONNECTION
WORKDIR /var/www/html
RUN apt-get update && apt-get install -y \
libpq-dev
RUN docker-php-ext-install pdo_pgsql
COPY --from=build /var/www/html/vendor /var/www/html/vendor