mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
php: add docker files
This commit is contained in:
14
web/documentserver-example/php/Dockerfile
Normal file
14
web/documentserver-example/php/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM php:8.2.8-fpm-alpine3.18 AS example
|
||||
WORKDIR /srv
|
||||
COPY . .
|
||||
RUN \
|
||||
chown -R www-data:www-data /srv && \
|
||||
apk update && \
|
||||
apk add --no-cache \
|
||||
composer \
|
||||
make && \
|
||||
make prod
|
||||
CMD ["make", "server-prod"]
|
||||
|
||||
FROM nginx:1.23.4-alpine3.17 AS proxy
|
||||
COPY proxy/nginx.conf /etc/nginx/nginx.conf
|
||||
40
web/documentserver-example/php/docker-compose.yml
Normal file
40
web/documentserver-example/php/docker-compose.yml
Normal file
@ -0,0 +1,40 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
document-server:
|
||||
container_name: document-server
|
||||
image: onlyoffice/documentserver:7.3.3.50
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
- JWT_SECRET=your-256-bit-secret
|
||||
|
||||
example:
|
||||
container_name: example
|
||||
build:
|
||||
context: .
|
||||
target: example
|
||||
expose:
|
||||
- "80"
|
||||
volumes:
|
||||
- "example:/srv"
|
||||
environment:
|
||||
- ADDRESS=0.0.0.0
|
||||
- DOCUMENT_SERVER_URL=http://localhost:8080/
|
||||
- EXAMPLE_URL=http://proxy
|
||||
- JWT_SECRET=your-256-bit-secret
|
||||
- PORT=80
|
||||
|
||||
proxy:
|
||||
container_name: proxy
|
||||
build:
|
||||
context: .
|
||||
target: proxy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "example:/srv"
|
||||
|
||||
volumes:
|
||||
example:
|
||||
47
web/documentserver-example/php/proxy/nginx.conf
Normal file
47
web/documentserver-example/php/proxy/nginx.conf
Normal file
@ -0,0 +1,47 @@
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 512;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
root /srv;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
index index.html index.php;
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_pass example:80;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
client_max_body_size 100m;
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass http://document-server;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host $http_x_forwarded_host;
|
||||
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user