2020-04-19 19:27:15 +02:00
|
|
|
# Stage 1: Build application
|
2020-04-30 21:20:33 +02:00
|
|
|
FROM node:13.14.0 AS compile-image
|
2020-04-19 19:27:15 +02:00
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
COPY . ./
|
|
|
|
|
2020-05-05 22:44:58 +02:00
|
|
|
RUN \
|
2020-05-01 12:19:52 +02:00
|
|
|
# Build the frontend
|
2020-06-22 16:15:13 +02:00
|
|
|
yarn install --frozen-lockfile --network-timeout 100000 && \
|
2020-05-09 21:57:59 +02:00
|
|
|
echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \
|
2020-05-05 23:31:01 +02:00
|
|
|
yarn run build
|
2020-04-19 19:27:15 +02:00
|
|
|
|
|
|
|
# Stage 2: copy
|
|
|
|
FROM nginx
|
2018-09-08 17:56:45 +02:00
|
|
|
|
2019-06-10 22:12:58 +02:00
|
|
|
RUN apt-get update && apt-get install -y apt-utils openssl && \
|
|
|
|
mkdir -p /etc/nginx/ssl && \
|
|
|
|
openssl genrsa -out /etc/nginx/ssl/dummy.key 2048 && \
|
|
|
|
openssl req -new -key /etc/nginx/ssl/dummy.key -out /etc/nginx/ssl/dummy.csr -subj "/C=DE/L=Berlin/O=Vikunja/CN=Vikunja Snakeoil" && \
|
|
|
|
openssl x509 -req -days 3650 -in /etc/nginx/ssl/dummy.csr -signkey /etc/nginx/ssl/dummy.key -out /etc/nginx/ssl/dummy.crt
|
|
|
|
|
2020-04-19 19:27:15 +02:00
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
2020-05-05 23:31:01 +02:00
|
|
|
COPY run.sh /run.sh
|
2020-04-19 19:27:15 +02:00
|
|
|
|
|
|
|
# copy compiled files from stage 1
|
|
|
|
COPY --from=compile-image /build/dist /usr/share/nginx/html
|
2019-06-10 22:12:58 +02:00
|
|
|
|
2020-05-22 18:11:20 +02:00
|
|
|
# Unprivileged user
|
|
|
|
ENV PUID 1000
|
|
|
|
ENV PGID 1000
|
|
|
|
|
2020-05-05 23:31:01 +02:00
|
|
|
LABEL maintainer="maintainers@vikunja.io"
|
|
|
|
|
|
|
|
CMD "/run.sh"
|