mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
docs on docker and cors
This commit is contained in:
parent
012bfc716f
commit
7ebb2d3781
21
docs/cors.md
Normal file
21
docs/cors.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Cross Origin Resource Sharing (CORS)
|
||||||
|
|
||||||
|
## Chrome Workaround
|
||||||
|
|
||||||
|
For the Chrome you can use the following plugin that allows you toggle CORS:
|
||||||
|
[Allow-Control-Allow-Origin](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi)
|
||||||
|
|
||||||
|
## Firefox Workaround
|
||||||
|
|
||||||
|
FireFox users can try the following plugin: [CORS Everywhere](https://addons.mozilla.org/en-Gb/firefox/addon/cors-everywhere/)
|
||||||
|
|
||||||
|
## Safari Workaround
|
||||||
|
|
||||||
|
If you are developing or testing with Safari then you can use the "Develop" menu to toggle the CORS mode.
|
||||||
|
Please note that page must be reloaded every time you change CORS settings.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## See also
|
||||||
|
|
||||||
|
- [Using CORS](https://www.html5rocks.com/en/tutorials/cors/)
|
88
docs/docker.md
Normal file
88
docs/docker.md
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# Using with Docker
|
||||||
|
|
||||||
|
<p class="warning">
|
||||||
|
This article assumes you are familiar with Docker and know how to create images and containers.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
You can create a Docker image to run Alfresco Content App in the container.
|
||||||
|
|
||||||
|
## Building from source code
|
||||||
|
|
||||||
|
You need to run the following commands to build the project from the source code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
That produces a build in the "dist" folder that you can use with a Docker image.
|
||||||
|
|
||||||
|
<p class="tip">
|
||||||
|
Also, you may need to update the `dist/app.config.json` file with the settings relevant to your scenario.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## Creating an image
|
||||||
|
|
||||||
|
The Content Application provides a "Dockerfile" file in the repository root.
|
||||||
|
You can build the image with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker image build -t content-app .
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running image in a container
|
||||||
|
|
||||||
|
To run the image locally, you can use the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker container run -p 80:80 --rm content-app
|
||||||
|
```
|
||||||
|
|
||||||
|
Navigate to "http://localhost" to access the running application.
|
||||||
|
|
||||||
|
## Docker Compose file
|
||||||
|
|
||||||
|
You can also use the "docker-compose" file for local development and testing.
|
||||||
|
To build and run container run the following command in the root project folder:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
To perform a cleanup operation, use the next command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker-compose down --rmi all
|
||||||
|
```
|
||||||
|
|
||||||
|
Navigate to "http://localhost:3000" to access the running application.
|
||||||
|
|
||||||
|
<p class="warning">
|
||||||
|
Please keep in mind that you should manually build the project every time you want to publish the image or run it locally with the container.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## Using with local ACS setup
|
||||||
|
|
||||||
|
If you run ACS at port 8080 as a Docker container (typical development configuration), you can use the following command to build the project before creating an image:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run build:dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The command above updates the "dist/app.config.json" file to point the Content App to "http://localhost:8080" upon startup.
|
||||||
|
Alternatively, you can change the configuration file manually before generating an image.
|
||||||
|
|
||||||
|
So the development workflow, in this case, is going to be:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run build:dev
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
Navigate to "http://localhost:3000" to access the running application.
|
||||||
|
|
||||||
|
To perform a cleanup operation, use the next command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker-compose down --rmi all
|
||||||
|
```
|
BIN
docs/images/safari-develop-menu.png
Normal file
BIN
docs/images/safari-develop-menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 KiB |
@ -17,6 +17,20 @@
|
|||||||
{
|
{
|
||||||
title: 'Home',
|
title: 'Home',
|
||||||
path: '/'
|
path: '/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Docker',
|
||||||
|
path: 'docker'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Guides',
|
||||||
|
type: 'dropdown',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
title: 'CORS',
|
||||||
|
path: 'cors'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
icons: [
|
icons: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user