2022-07-16 09:22:58 +02:00
|
|
|
FROM node:18 as build
|
2022-02-05 20:17:00 +01:00
|
|
|
ARG VITE_API_URL
|
|
|
|
ARG VITE_BOT_PREFIX
|
2022-07-12 18:07:17 +02:00
|
|
|
WORKDIR /build/app
|
|
|
|
COPY web/package.json web/yarn.lock web/.yarnrc.yml ./
|
|
|
|
COPY web/.yarn ./.yarn
|
|
|
|
COPY lib ../lib
|
2022-07-15 18:03:51 +02:00
|
|
|
RUN yarn --cwd ../lib --immutable
|
2022-07-15 17:57:40 +02:00
|
|
|
RUN yarn --cwd ../lib build
|
2022-07-09 07:18:03 +02:00
|
|
|
RUN yarn install --immutable
|
2022-07-12 18:07:17 +02:00
|
|
|
COPY web .
|
2022-02-05 20:17:00 +01:00
|
|
|
RUN yarn build
|
|
|
|
|
2022-07-16 09:22:58 +02:00
|
|
|
FROM node:18 as prod
|
2022-07-12 18:07:17 +02:00
|
|
|
WORKDIR /app/web
|
|
|
|
COPY --from=build /build/app/package.json /build/app/yarn.lock /build/app/.yarnrc.yml ./
|
|
|
|
COPY --from=build /build/app/.yarn ./.yarn
|
|
|
|
COPY --from=build /build/app/dist ./dist
|
2022-07-16 09:22:58 +02:00
|
|
|
COPY --from=build /build/lib ../lib
|
2022-07-09 07:18:03 +02:00
|
|
|
RUN yarn add vite
|
2022-02-05 20:17:00 +01:00
|
|
|
# Running this with bash -c because it won't exit on ctrl+c otherwise
|
|
|
|
CMD ["bash", "-c", "yarn preview --port=80 --strictPort=true --clearScreen=false --host"]
|