forked from activepieces/activepieces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (40 loc) · 1.57 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
### STAGE 1: Build ###
FROM activepieces/ap-base:7 AS build
# Set up backend
WORKDIR /usr/src/app
COPY . .
RUN apt update && apt install -y cmake libopenblas-dev patchelf
# Install backend dependencies and build the projects
COPY .npmrc package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npx nx run-many --target=build --projects=backend,ui-core --skip-nx-cache
# Install backend production dependencies
RUN cd dist/packages/backend && \
npm install --production --force
### STAGE 2: Run ###
FROM activepieces/ap-base:7 AS run
ARG AP_CACHE_PATH=/usr/src/cache
ARG AP_PACKAGE_ARCHIVE_PATH=/usr/src/packages
# Set default environment to "standard" if not specified
ARG ENVIRONMENT=standard
# Set up backend
WORKDIR /usr/src/app
# Install Nginx and gettext for envsubst
RUN apt-get update && \
apt-get install -y nginx gettext
# Copy Nginx configuration template
COPY packages/ui/core/nginx.${ENVIRONMENT}.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/LICENSE /usr/src/app/LICENSE
# Copy Output files to appropriate directory from build stage
COPY --from=build /usr/src/app/dist/ /usr/src/app/dist/
# Copy Output files to appropriate directory from build stage
COPY --from=build /usr/src/app/packages/ /usr/src/app/packages/
# Copy frontend files to Nginx document root directory from build stage
COPY --from=build /usr/src/app/dist/packages/ui/core/ /usr/share/nginx/html/
VOLUME [${AP_CACHE_PATH}, ${AP_PACKAGE_ARCHIVE_PATH}]
# Set up entrypoint script
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 80