Skip to content

Commit

Permalink
Add Dockerfile (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacata authored Jul 9, 2021
1 parent c39541a commit 032c0dc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contains files which should be ignored in the build context.

# This includes large files and folders which might exist locally
# but are not needed during docker build to speed up build time
dist
node_modules
.git

# and files which are equally not needed and would break the
# build cache at an early step (COPY . ...) if changed.
Dockerfile
.dockerignore
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:16-alpine3.11 as build

# Copy source code
COPY . /src/openeo-web-editor
WORKDIR /src/openeo-web-editor

# Build
RUN npm install
RUN npm run build

# Copy build folder and run with nginx
FROM nginx:1.20.1-alpine
COPY --from=build /src/openeo-web-editor/dist /usr/share/nginx/html
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can also build the files yourself and deploy them to any web host:
3. Open a command line window and go to the directory which contains the cloned/downloaded web editor files.
4. Configure the web editor by editing `config.js` and `vue.config.js` to suit your needs.
6. Install the dependencies by executing `npm install` on the command line
7.
7.
* Development: Run the development server by executing `npm start`.
* Deployment: Build the project by executing `npm run build`. Afterwards upload the content of the `dist` folder to your server.

Expand All @@ -37,3 +37,16 @@ Example: <https://editor.openeo.org?server=https://earthengine.openeo.org&discov

## License
This project is licensed under the Apache 2.0 license - see the [LICENSE.md](LICENSE.md) file for details.

## Docker
This repository contains a Dockerfile. It can be build with
```
docker build . -t openeo-web-editor
```
and then tested locally with
```
docker run -p 8080:80 openeo-web-editor
```
After sucessfull startup, the webeditor can be reached locally at http://127.0.0.1:8080/

More startup information can be seen at the [official nginx docker image](https://hub.docker.com/_/nginx/) which is used.

0 comments on commit 032c0dc

Please sign in to comment.