-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 903 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
###################### FRONTEND BUILD ##########################################
FROM node:16-alpine AS frontend_build
COPY ./frontend /app/frontend
WORKDIR /app/frontend
RUN npm install && npm run deploy
###################### BACKEND BUILD ###########################################
FROM rust:1.63-bullseye AS backend_build
WORKDIR /app
COPY . /app
RUN cargo build --release
###################### RUNTIME IMAGE ###########################################
FROM debian:bullseye-slim
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends ca-certificates openssl \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*WORKDIR
# Run as "app" user
RUN useradd -ms /bin/bash app
USER app
WORKDIR /app
COPY --from=backend_build /app/target/release/robo_radio /app/robo_radio
COPY --from=frontend_build /app/assets /app/assets
CMD ["./robo_radio"]