docker
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
# Install libc6-compat for compatibility with native node modules
|
||||
RUN apk add --no-cache libc6-compat
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Expose Next.js port
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT 3000
|
||||
ENV HOSTNAME "0.0.0.0"
|
||||
|
||||
# Automatically install dependencies (to handle architecture differences between Windows host and Linux container)
|
||||
# and run Next.js in development mode
|
||||
CMD ["sh", "-c", "npm install && npm run dev"]
|
||||
@@ -0,0 +1,39 @@
|
||||
# Increase buffer limits to prevent "400 Bad Request - Request Header Or Cookie Too Large"
|
||||
# These must be in the http context (outside the server block) to be applied during initial request parsing
|
||||
large_client_header_buffers 4 64k;
|
||||
client_header_buffer_size 16k;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# Increase upload limits for maps or databases if needed
|
||||
client_max_body_size 64M;
|
||||
|
||||
# Next.js Application
|
||||
location /sistem-km-next {
|
||||
proxy_pass http://next-app:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
|
||||
# Standard proxy headers
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# Disable buffering for hot module reloading (HMR) / Server Sent Events (SSE)
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
||||
# PHP + Static Web GIS application
|
||||
location / {
|
||||
proxy_pass http://php-app:80;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
FROM php:8.2-apache
|
||||
|
||||
# Install PDO MySQL extension for database connectivity
|
||||
RUN docker-php-ext-install pdo pdo_mysql
|
||||
|
||||
# Enable Apache rewrite module
|
||||
RUN a2enmod rewrite
|
||||
|
||||
# Increase request header field size limit to prevent "Size of a request header field exceeds server limit"
|
||||
RUN echo "LimitRequestFieldSize 65536" >> /etc/apache2/apache2.conf
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user