-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (32 loc) · 920 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# build stage
FROM node:lts-alpine as build-stage
ARG DEFAULT_LANGUAGE
ARG CHATBOT_FRONTEND_URL
ARG DEFAULT_CHATBOT_BACKEND_URL
ARG DEFAULT_CHATBOT_COMPONENTS
ARG INITIAL_QUESTION_PARAMETER_NAME
ARG DEFAULT_BACKEND_TYPE
ARG DEFAULT_THEME
ARG INITIAL_MESSAGE_TEXT_DE
ARG INITIAL_MESSAGE_TEXT_EN
ARG PAGE_TITLE_DE
ARG PAGE_TITLE_EN
WORKDIR /app
COPY ./package*.json ./
RUN npm ci
COPY . ./
RUN PUBLIC_URL="$CHATBOT_FRONTEND_URL" npm run build
# production stage
FROM nginx:stable-alpine as production-stage
WORKDIR /usr/share/nginx/html
COPY --from=build-stage /app/build .
#COPY ./docker/certs /etc/nginx/certs
COPY ./docker/nginx/nginx.conf /etc/nginx/conf.d/nginx.conf
COPY ./env.sh .
COPY template.env ./.env
# Add bash
RUN apk add --no-cache bash
# Make our shell script executable
RUN chmod +x env.sh
# Start Nginx server
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]