|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Docker image deployment in React Spreadsheet component | Syncfusion |
| 4 | +description: Learn here all about Docker image deployment in Syncfusion React Spreadsheet component of Syncfusion Essential JS 2 and more. |
| 5 | +platform: document-processing |
| 6 | +control: Docker deployment |
| 7 | +documentation: ug |
| 8 | +--- |
| 9 | + |
| 10 | +# Docker Image Overview in React Spreadsheet component |
| 11 | + |
| 12 | +The [**Syncfusion<sup style="font-size:70%">®</sup> Spreadsheet (also known as Excel Viewer)**](https://www.syncfusion.com/spreadsheet-editor-sdk/react-spreadsheet-editor) is a feature-rich control for organizing and analyzing data in a tabular format. It provides all the common Excel features, including data binding, selection, editing, formatting, resizing, sorting, filtering, importing, and exporting Excel documents. |
| 13 | + |
| 14 | +This Docker image is the pre-defined Docker container for Syncfusion's Spreadsheet back-end functionalities. This server-side Web API project targets ASP.NET Core 8.0. |
| 15 | + |
| 16 | +You can deploy it quickly to your infrastructure. If you want to add new functionality or customize any existing functionalities, create your own Docker file by referencing the existing [Spreadsheet Docker project](https://github.com/SyncfusionExamples/Spreadsheet-Server-Docker). |
| 17 | + |
| 18 | +The Spreadsheet is supported on the [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), [ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), and [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls) platforms. |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +Have [`Docker`](https://www.docker.com/products/container-runtime#/download) installed in your environment: |
| 23 | + |
| 24 | +* On Windows, install [`Docker for Windows`](https://hub.docker.com/editions/community/docker-ce-desktop-windows). |
| 25 | +* On macOS, install [`Docker for Mac`](https://docs.docker.com/desktop/install/mac-install/). |
| 26 | + |
| 27 | +## How to deploy the Spreadsheet Docker Image |
| 28 | + |
| 29 | +**Step 1:** Pull the spreadsheet-server image from Docker Hub. |
| 30 | + |
| 31 | +```console |
| 32 | +docker pull syncfusion/spreadsheet-server |
| 33 | +``` |
| 34 | + |
| 35 | +**Step 2:** Create the `docker-compose.yml` file with the following code in your file system. |
| 36 | + |
| 37 | +```yaml |
| 38 | +version: '3.4' |
| 39 | + |
| 40 | +services: |
| 41 | + spreadsheet-server: |
| 42 | + image: syncfusion/spreadsheet-server:latest |
| 43 | + environment: |
| 44 | + # Provide your license key for activation |
| 45 | + SYNCFUSION_LICENSE_KEY: YOUR_LICENSE_KEY |
| 46 | + ports: |
| 47 | + - "6002:8080" |
| 48 | +``` |
| 49 | +
|
| 50 | +**Note:** The Spreadsheet is a commercial product. It requires a valid [license key](https://help.syncfusion.com/common/essential-studio/licensing/licensing-faq/where-can-i-get-a-license-key) to use in a production environment. Please replace `YOUR_LICENSE_KEY` with the valid license key in the `docker-compose.yml` file. |
| 51 | + |
| 52 | +**Step 3:** In a terminal tab, navigate to the directory where you've placed the `docker-compose.yml` file and execute the following: |
| 53 | + |
| 54 | +```console |
| 55 | +docker-compose up |
| 56 | +``` |
| 57 | + |
| 58 | +Now the Spreadsheet server Docker instance runs on localhost with the provided port number `http://localhost:6002`. Open this link in a browser and navigate to the Spreadsheet Web API open and save service at `http://localhost:6002/api/spreadsheet/open` and `http://localhost:6002/api/spreadsheet/save`. |
| 59 | + |
| 60 | +**Step 4:** Append the URLs of the Docker instance running services to the [`openUrl`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#openurl) property as `http://localhost:6002/api/spreadsheet/open` and the [`saveUrl`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#saveurl) property as `http://localhost:6002/api/spreadsheet/save` in the client-side Spreadsheet component. For more information on how to get started with the Spreadsheet component, refer to this [`getting started page.`](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/getting-started) |
| 61 | + |
| 62 | +```js |
| 63 | +import * as React from 'react'; |
| 64 | +import { createRoot } from 'react-dom/client'; |
| 65 | +import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet'; |
| 66 | +
|
| 67 | +function App() { |
| 68 | +
|
| 69 | + return ( |
| 70 | + // Initialize Spreadsheet component. |
| 71 | + <SpreadsheetComponent openUrl='http://localhost:6002/api/spreadsheet/open' saveUrl='http://localhost:6002/api/spreadsheet/save' /> |
| 72 | + ); |
| 73 | +}; |
| 74 | +export default App; |
| 75 | +
|
| 76 | +const root = createRoot(document.getElementById('root')); |
| 77 | +root.render(<App />); |
| 78 | +``` |
| 79 | + |
| 80 | +## How to configure different cultures using a Docker compose file |
| 81 | + |
| 82 | +By default, the Spreadsheet Docker container is generated in the `en_US` culture. You can configure different cultures using the `LC_ALL`, `LANGUAGE`, and `LANG` environment variables in the `docker-compose.yml` file. These environment variables are replaced in the Docker file to set the specified culture for the Spreadsheet server. |
| 83 | + |
| 84 | +```yaml |
| 85 | +version: '3.4' |
| 86 | +
|
| 87 | +services: |
| 88 | + spreadsheet-server: |
| 89 | + image: syncfusion/spreadsheet-server:latest |
| 90 | + environment: |
| 91 | + # Provide your license key for activation |
| 92 | + SYNCFUSION_LICENSE_KEY: YOUR_LICENSE_KEY |
| 93 | + # Specify the culture to configure for the Spreadsheet server |
| 94 | + LC_ALL: de_DE.UTF-8 |
| 95 | + LANGUAGE: de_DE.UTF-8 |
| 96 | + LANG: de_DE.UTF-8 |
| 97 | + ports: |
| 98 | + - "6002:8080" |
| 99 | +``` |
| 100 | + |
| 101 | +Please refer to these getting started pages to create a Spreadsheet in [`Javascript`](https://help.syncfusion.com/document-processing/excel/spreadsheet/javascript-es5/getting-started), [`Angular`](https://help.syncfusion.com/document-processing/excel/spreadsheet/angular/getting-started), [`Vue`](https://help.syncfusion.com/document-processing/excel/spreadsheet/vue/getting-started), [`ASP.NET Core`](https://help.syncfusion.com/document-processing/excel/spreadsheet/asp-net-core/getting-started-core), and [`ASP.NET MVC`](https://help.syncfusion.com/document-processing/excel/spreadsheet/asp-net-mvc/getting-started-mvc). |
0 commit comments