mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
ruby: add docker files
This commit is contained in:
23
web/documentserver-example/ruby/Dockerfile
Normal file
23
web/documentserver-example/ruby/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM ruby:3.2.2-alpine3.18 AS example-base
|
||||
WORKDIR /srv
|
||||
COPY . .
|
||||
RUN \
|
||||
apk update && \
|
||||
apk add --no-cache \
|
||||
build-base \
|
||||
gcompat \
|
||||
git \
|
||||
make \
|
||||
nodejs && \
|
||||
gem install bundler -v 2.3.7
|
||||
|
||||
FROM example-base AS example-dev
|
||||
RUN make dev
|
||||
CMD ["make", "server-dev"]
|
||||
|
||||
FROM example-base AS example-prod
|
||||
RUN make prod
|
||||
CMD ["make", "server-prod"]
|
||||
|
||||
FROM nginx:1.23.4-alpine3.17 AS proxy
|
||||
COPY proxy/nginx.conf /etc/nginx/nginx.conf
|
||||
33
web/documentserver-example/ruby/compose-base.yml
Normal file
33
web/documentserver-example/ruby/compose-base.yml
Normal file
@ -0,0 +1,33 @@
|
||||
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"
|
||||
environment:
|
||||
- BINDING=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"
|
||||
6
web/documentserver-example/ruby/compose-dev.yml
Normal file
6
web/documentserver-example/ruby/compose-dev.yml
Normal file
@ -0,0 +1,6 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
example:
|
||||
build:
|
||||
target: example-dev
|
||||
6
web/documentserver-example/ruby/compose-prod.yml
Normal file
6
web/documentserver-example/ruby/compose-prod.yml
Normal file
@ -0,0 +1,6 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
example:
|
||||
build:
|
||||
target: example-prod
|
||||
38
web/documentserver-example/ruby/proxy/nginx.conf
Normal file
38
web/documentserver-example/ruby/proxy/nginx.conf
Normal file
@ -0,0 +1,38 @@
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 512;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass http://example;
|
||||
}
|
||||
}
|
||||
|
||||
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