1
0
mirror of https://github.com/ONLYOFFICE/Docker-Docs.git synced 2025-04-18 15:04:02 +03:00

Add instruction for building custom images (#44)

This commit is contained in:
Vyacheslav Semin 2022-04-08 16:18:13 +03:00 committed by GitHub
parent c05d9847bd
commit 736cf5a46e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 84 additions and 10 deletions

18
.env
View File

@ -1,3 +1,17 @@
# Your Docker Hub account
ACCOUNT_NAME=onlyoffice
# Service variable. You don't need to change it
COMPANY_NAME=onlyoffice
PRODUCT_NAME=docs
PRODUCT_VERSION=latest
# ONLYOFFICE Docs solution type.
# Allowed values: Nothing is specified - Community version,
# `-de` - Developer Edition,
# `-ee` - Enterprise Edition
PRODUCT_EDITION=
# Prefix in the name of your repository in Docker Hub
PREFIX_NAME=docs
# Image tag
DOCKER_TAG=latest

View File

@ -25,11 +25,68 @@ ONLYOFFICE Docs has three editions - [Community, Enterprise, and Developer](http
* **HDD**: at least 2 GB of free space
* **Distribution**: 64-bit Red Hat, CentOS or other compatible distributive with kernel version 3.8 or later, 64-bit Debian, Ubuntu or other compatible distributive with kernel version 3.8 or later
* **Docker**: version 1.9.0 or later
* **Docker-compose**: version 1.28.0 or later
## Building ONLYOFFICE Docs
### Cloning this repository
To clone this repository, run the following command:
```bash
git clone https://github.com/ONLYOFFICE/Docker-Docs.git
```
Go to the Docker-Docs directory.
### Adding custom Fonts (optional)
To add your custom fonts to the images, add your custom fonts to the `fonts` directory.
### Adding Plugins (optional)
To add plugins to the images, add the folder with the plugin code to the `plugins` directory.
### Building images
To build images, please follow these steps
#### 1. Change the variables
Change the value of the `ACCOUNT_NAME` variable in the `.env` file. It must contain the account name in Docker Hub. If necessary, change the values of the variables `PREFIX_NAME` and `DOCKER_TAG` in the `.env` file.
Also, depending on the solution type, specify the required value for the `PRODUCT_EDITION` variable in the `.env` file.
Possible values:
- Nothing is specified. For the open-source community version. Default,
- `-de`. For commercial Developer Edition,
- `-ee`. For commercial Enterprise Edition.
#### 2. Run the build
To start the build, run the following command:
```bash
./build.sh
```
#### 3. Publish the images to the image repository
Log in to the local host:
```bash
docker login
```
To publish the images, run the following command:
```bash
docker-compose push
```
## Running ONLYOFFICE Docs
Install [docker-compose](https://docs.docker.com/compose/install "docker-compose"). If you have docker-compose installed, execute the following command:
Execute the following command:
```bash
docker-compose up -d

5
build.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
source .env
export DOCKER_BUILDKIT=1
docker-compose build --build-arg PRODUCT_EDITION=$PRODUCT_EDITION

View File

@ -5,7 +5,7 @@ services:
build:
context: .
target: proxy
image: ${COMPANY_NAME}/${PRODUCT_NAME}-proxy${PRODUCT_EDITION}:${PRODUCT_VERSION}
image: ${ACCOUNT_NAME}/${PREFIX_NAME}-proxy${PRODUCT_EDITION}:${DOCKER_TAG}
environment:
- DOCSERVICE_HOST_PORT=docservice:8000
- EXAMPLE_HOST_PORT=example:3000
@ -20,7 +20,7 @@ services:
build:
context: .
target: docservice
image: ${COMPANY_NAME}/${PRODUCT_NAME}-docservice${PRODUCT_EDITION}:${PRODUCT_VERSION}
image: ${ACCOUNT_NAME}/${PREFIX_NAME}-docservice${PRODUCT_EDITION}:${DOCKER_TAG}
container_name: docservice
environment:
- DB_HOST=postgresql
@ -48,7 +48,7 @@ services:
build:
context: .
target: converter
image: ${COMPANY_NAME}/${PRODUCT_NAME}-converter${PRODUCT_EDITION}:${PRODUCT_VERSION}
image: ${ACCOUNT_NAME}/${PREFIX_NAME}-converter${PRODUCT_EDITION}:${DOCKER_TAG}
container_name: converter
environment:
- DB_HOST=postgresql
@ -79,7 +79,7 @@ services:
- '8126'
example:
image: ${COMPANY_NAME}/${PRODUCT_NAME}-example:${PRODUCT_VERSION}
image: ${COMPANY_NAME}/${PREFIX_NAME}-example:${DOCKER_TAG}
container_name: example
environment:
- JWT_ENABLED=false

View File

@ -1,5 +1,4 @@
#!/bin/bash
export PRODUCT_VERSION=$DOCKER_TAG
export DOCKER_BUILDKIT=1
docker-compose build --build-arg PRODUCT_EDITION=$PRODUCT_EDITION

View File

@ -1,4 +1,3 @@
#!/bin/bash
export PRODUCT_VERSION=$DOCKER_TAG
docker-compose push