forked from laudspeaker/laudspeaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod.client
23 lines (22 loc) · 853 Bytes
/
Dockerfile.prod.client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# To build: docker build -f Dockerfile.prod.client -t laudspeaker:latest .
# To run: docker run -it -p 3000:80 --rm laudspeaker:latest
FROM node:16 as build
WORKDIR /app
ENV REACT_APP_API_BASE_URL https://api.laudspeaker.com
ENV REACT_APP_POSTHOG_HOST https://app.posthog.com
ENV REACT_APP_POSTHOG_KEY RxdBl8vjdTwic7xTzoKTdbmeSC1PCzV6sw-x-FKSB-k
ENV PATH /app/node_modules/.bin:$PATH
COPY ./packages/client/package.json /app/
COPY ./package-lock.json /app/
RUN npm install --legacy-peer-deps
COPY . /app
RUN npm run format:client
RUN npm run build:client
# stage 2 - build the final image and copy the react build files
FROM nginx:1.17.8-alpine
COPY --from=build /app/packages/client/build /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/prod.nginx.conf /etc/nginx/conf.d
EXPOSE 80
EXPOSE 443
CMD ["nginx", "-g", "daemon off;"]