Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Oenings committed Jun 18, 2024
0 parents commit 047a275
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "masterportal"]
path = masterportal
url = https://bitbucket.org/geowerkstatt-hamburg/masterportal
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Dockerfile for Masterportal v3
#

# Pull dependencies.
# This is separated from the build to improve caching
FROM node:20-bullseye-slim AS build-environment
ARG HTTP_PROXY
ARG HTTPS_PROXY
WORKDIR /opt/masterportal
COPY masterportal/package.json masterportal/package-lock.json ./
ENV NODE_ENVIRONMENT development
RUN npm config set proxy "${HTTP_PROXY}"
RUN npm config set https-proxy "${HTTPS_PROXY}"
RUN npm ci

# Build Masterportal.
# Only the necessary folders are copied to keep the image small
# The basic portal is used for building only; include your own config via volume
# We always use mastercode version "docker" to allow updates with no change to the portal
FROM node:20-bullseye-slim AS build
WORKDIR /opt/masterportal
COPY --from=build-environment /opt/masterportal/node_modules node_modules
COPY masterportal/package.json masterportal/package-lock.json ./
COPY masterportal/img img
COPY masterportal/js js
COPY masterportal/src_3_0_0 src_3_0_0
COPY masterportal/locales_3_0_0 locales_3_0_0
COPY masterportal/devtools devtools
COPY lib/getMastercodeVersionFolderName.js devtools/tasks/getMastercodeVersionFolderName.js
COPY masterportal/modules modules
COPY masterportal/addons addons
COPY masterportal/portal/basic portal/basic
ENV NODE_ENVIRONMENT production
RUN npm run buildPortal

# Production image (exported).
# This only needs a static webserver serving the masterportal
FROM caddy:2
COPY --from=build /opt/masterportal/dist/mastercode /srv/www/mastercode

EXPOSE 80/tcp
CMD [ "caddy", "file-server", "--root", "/srv/www" ]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Masterportal-Cloud

This repository provides a Dockerfile for the [Masterportal](https://masterportal.org).

## Building the docker image from source
To build the docker image from source, you need to clone this repository and run `docker build`:

```bash
git clone --recurse-submodules https://github.com/Dataport/masterportal-cloud
cd masterportal-cloud
docker build -t masterportal .
```

## Future plans

- Provide a Helm chart for Kubernetes deployments
1 change: 1 addition & 0 deletions lib/getMastercodeVersionFolderName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = () => 'docker'
1 change: 1 addition & 0 deletions masterportal
Submodule masterportal added at e0d85e

0 comments on commit 047a275

Please sign in to comment.