|
| 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: ej2-react |
| 6 | +control: Docker deployment |
| 7 | +documentation: ug |
| 8 | +domainurl: ##DomainURL## |
| 9 | +--- |
| 10 | + |
| 11 | +# Docker Image Overview in React Spreadsheet component |
| 12 | + |
| 13 | +The [**Syncfusion Spreadsheet (also known as Excel Viewer)**](https://www.syncfusion.com/react-components/react-spreadsheet) 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. |
| 14 | + |
| 15 | +This Docker image is the pre-defined Docker container for Syncfusion's Spreadsheet backend functionalities. This server-side Web API project targets ASP.NET Core 6.0. |
| 16 | + |
| 17 | +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). |
| 18 | + |
| 19 | +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. |
| 20 | + |
| 21 | +## Prerequisites |
| 22 | + |
| 23 | +Have [`Docker`](https://www.docker.com/products/container-runtime#/download) installed in your environment: |
| 24 | + |
| 25 | +* On Windows, install [`Docker for Windows`](https://hub.docker.com/editions/community/docker-ce-desktop-windows). |
| 26 | +* On macOS, install [`Docker for Mac`](https://docs.docker.com/desktop/install/mac-install/). |
| 27 | + |
| 28 | +## How to deploy the Spreadsheet Docker Image |
| 29 | + |
| 30 | +**Step 1:** Pull the spreadsheet-server image from Docker Hub. |
| 31 | + |
| 32 | +```console |
| 33 | +docker pull syncfusion/spreadsheet-server |
| 34 | +``` |
| 35 | + |
| 36 | +**Step 2:** Create the `docker-compose.yml` file with the following code in your file system. |
| 37 | + |
| 38 | +```yaml |
| 39 | +version: '3.4' |
| 40 | + |
| 41 | +services: |
| 42 | + spreadsheet-server: |
| 43 | + image: syncfusion/spreadsheet-server:latest |
| 44 | + environment: |
| 45 | + # Provide your license key for activation |
| 46 | + SYNCFUSION_LICENSE_KEY: YOUR_LICENSE_KEY |
| 47 | + ports: |
| 48 | + - "6002:80" |
| 49 | +``` |
| 50 | +
|
| 51 | +**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. |
| 52 | + |
| 53 | +**Step 3:** In a terminal tab, navigate to the directory where you've placed the `docker-compose.yml` file and execute the following: |
| 54 | + |
| 55 | +```console |
| 56 | +docker-compose up |
| 57 | +``` |
| 58 | + |
| 59 | +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`. |
| 60 | + |
| 61 | +**Step 4:** Append the URLs of the Docker instance running services to the [`openUrl`](https://helpej2.syncfusion.com/react/documentation/api/spreadsheet/#openurl) property as `http://localhost:6002/api/spreadsheet/open` and the [`saveUrl`](https://helpej2.syncfusion.com/react/documentation/api/spreadsheet/#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://ej2.syncfusion.com/react/documentation/spreadsheet/getting-started) |
| 62 | + |
| 63 | +```js |
| 64 | +import * as React from 'react'; |
| 65 | +import { createRoot } from 'react-dom/client'; |
| 66 | +import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet'; |
| 67 | +
|
| 68 | +function App() { |
| 69 | +
|
| 70 | + return ( |
| 71 | + // Initialize Spreadsheet component. |
| 72 | + <SpreadsheetComponent openUrl='http://localhost:6002/api/spreadsheet/open' saveUrl='http://localhost:6002/api/spreadsheet/save' /> |
| 73 | + ); |
| 74 | +}; |
| 75 | +export default App; |
| 76 | +
|
| 77 | +const root = createRoot(document.getElementById('root')); |
| 78 | +root.render(<App />); |
| 79 | +``` |
| 80 | + |
| 81 | +## How to configure different cultures using a Docker compose file |
| 82 | + |
| 83 | +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. |
| 84 | + |
| 85 | +```yaml |
| 86 | +version: '3.4' |
| 87 | +
|
| 88 | +services: |
| 89 | + spreadsheet-server: |
| 90 | + image: syncfusion/spreadsheet-server:latest |
| 91 | + environment: |
| 92 | + # Provide your license key for activation |
| 93 | + SYNCFUSION_LICENSE_KEY: YOUR_LICENSE_KEY |
| 94 | + # Specify the culture to configure for the Spreadsheet server |
| 95 | + LC_ALL: de_DE.UTF-8 |
| 96 | + LANGUAGE: de_DE.UTF-8 |
| 97 | + LANG: de_DE.UTF-8 |
| 98 | + ports: |
| 99 | + - "6002:80" |
| 100 | +``` |
| 101 | + |
| 102 | +Please refer to these getting started pages to create a Spreadsheet in [`Javascript`](https://ej2.syncfusion.com/javascript/documentation/spreadsheet/getting-started), [`Angular`](https://ej2.syncfusion.com/angular/documentation/spreadsheet/getting-started), [`Vue`](https://ej2.syncfusion.com/vue/documentation/spreadsheet/getting-started), [`ASP.NET Core`](https://ej2.syncfusion.com/aspnetcore/documentation/spreadsheet/getting-started-core), and [`ASP.NET MVC`](https://ej2.syncfusion.com/aspnetmvc/documentation/spreadsheet/getting-started-mvc). |
0 commit comments