-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bdc
40 lines (32 loc) · 1.59 KB
/
Dockerfile.bdc
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
# Step 1: Build the app with node
FROM node:23.0.0-alpine3.19 AS builder
WORKDIR /app
COPY package*.json .
COPY .env .
RUN npm ci
COPY . .
RUN sed -i 's/%sveltekit.assets%\/favicon.ico/%sveltekit.assets%\/bdc-favicon.png/' ./src/app.html
RUN sed -i 's/data-theme="[^"]*"/data-theme="bdc-theme"/' ./src/app.html
RUN npm run build
RUN npm ci --omit dev
# Step 2: Serve the app with httpd
FROM httpd:2.4.62-alpine
RUN apk add --update openssl sed nodejs supervisor
RUN mkdir -p ${HTTPD_PREFIX}/cert
RUN sed -i '/^#Include conf.extra.httpd-vhosts.conf/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN sed -i '/^#LoadModule proxy_module/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN sed -i '/^#LoadModule proxy_http_module/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN sed -i '/^#LoadModule proxy_connect_module/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN sed -i '/^#LoadModule ssl_module modules\/mod_ssl.so/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN sed -i '/^#LoadModule rewrite_module modules\/mod_rewrite.so/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN sed -i '/^#LoadModule socache_shmcb_module modules\/mod_socache_shmcb.so/s/^#//' ${HTTPD_PREFIX}/conf/httpd.conf
RUN mkdir -p /usr/local/apache2/logs/ssl_mutex
RUN sed -i 's/Options Indexes FollowSymLinks/Options -Indexes +FollowSymLinks/' ${HTTPD_PREFIX}/conf/httpd.conf
WORKDIR /app
RUN mkdir -p logs
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
ENV NODE_ENV=production
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]