-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (18 loc) · 744 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (18 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM rust:1.81-slim-bookworm AS builder
RUN apt-get update
RUN apt-get install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install -y nodejs
WORKDIR /usr/src/app
COPY . .
WORKDIR /usr/src/app/www
ENV NODE_ENV=production
RUN npm install
RUN npm run build
FROM nginx:1.27
COPY --from=builder /usr/src/app/www/default.conf.template /etc/nginx/conf.d/default.conf.template
COPY --from=builder /usr/src/app/www/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /usr/src/app/www/dist /usr/share/nginx/html
SHELL ["/bin/bash", "-c"]
ENTRYPOINT envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'