-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathDockerfile
36 lines (24 loc) · 898 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
# Biuld phase.
FROM node:16.14-alpine as build
WORKDIR /app
COPY ./ui/ .
# RUN --mount=type=bind,id=pnpm,source=.pnpm-store,target=/app/.pnpm-store
ARG API_URL_PREFIX
ENV REACT_APP_API_URL_PREFIX ${API_URL_PREFIX}
ARG WS_URL_PREFIX
ENV REACT_APP_WS_URL_PREFIX ${WS_URL_PREFIX}
RUN apk add --no-cache --update git && \
npm i -g pnpm@7.30.5; \
pnpm config set store-dir /app/.pnpm-store; \
pnpm set verify-store-integrity false; \
pnpm --filter @postgres.ai/ce i; \
pnpm --filter @postgres.ai/ce build
# Run phase.
FROM nginx:1.20.1-alpine as run
COPY --from=build /app/packages/ce/build /srv/ce
COPY ./ui/packages/ce/nginx.conf /etc/nginx/conf.d/ce.conf.template
COPY ./ui/packages/ce/docker-entrypoint.sh /
RUN rm -f /etc/nginx/conf.d/default.conf && chmod +x /docker-entrypoint.sh
EXPOSE 2346
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]