This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/Dockerfile
kolaente 40721e7a74
All checks were successful
continuous-integration/drone/push Build is passing
Fix setting api url when building docker image
2020-05-01 12:19:52 +02:00

28 lines
890 B
Docker

# Stage 1: Build application
FROM node:13.14.0 AS compile-image
WORKDIR /build
COPY . ./
# Override config
RUN echo '{"VIKUNJA_API_BASE_URL": "/api/v1/"}' > /build/public/config.json && \
# Build the frontend
yarn install --frozen-lockfile && \
yarn run build
# Stage 2: copy
FROM nginx
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
COPY nginx.conf /etc/nginx/nginx.conf
# copy compiled files from stage 1
COPY --from=compile-image /build/dist /usr/share/nginx/html
LABEL maintainer="maintainers@vikunja.io"