super-productivity/Dockerfile
Kingsley Yung 8ab9092dcd feat: webdav integration
This patch provides an optional way to integrate an external WebDAV server so that the super-productivity container can serve as a WebDAV server with base url http://localhost/webdav/ . It includes the following changes:

**Replace the default nginx config file**
Besides serving the web app, the new nginx config file also forwards all the requests with paths starting with "/webdav/" to a backend WebDAV server specified by the environment variable WEBDAV_BACKEND. Note that during forwarding, the path prefix "/webdav" will be removed.

**Use hacdias/webdav as default WebDAV backend server**
The docker-compose.yaml provides an example setup to use the docker image [hacdias/webdav](https://github.com/hacdias/webdav) as the WebDAV backend server. An example for the configuration of the WebDAV server is also provided in webdav.yaml.
2024-10-11 12:02:05 +02:00

44 lines
767 B
Docker

# builds the app and runs the webversion inside a docker container
### build ###
# base image
FROM node:20 as build
# add app
COPY . /app
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
RUN npm i
RUN npm i -g @angular/cli
# run linter
RUN npm run lint
# generate build
RUN npm run buildFrontend:prodWeb
### serve ###
# base image
FROM nginx:1-alpine
# environmental variables
ENV PORT=80
# copy artifact build from the 'build environment'
COPY --from=build /app/dist/browser /usr/share/nginx/html
# copy nginx config
COPY ./nginx/default.conf.template /etc/nginx/templates/default.conf.template
# expose port: defaults to 80
EXPOSE $PORT
# run nginx
CMD ["nginx", "-g", "daemon off;"]