-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (25 loc) · 812 Bytes
/
Dockerfile
File metadata and controls
39 lines (25 loc) · 812 Bytes
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
FROM rust:latest AS backend
WORKDIR /app
RUN rustup install nightly && \
rustup default nightly && \
rustup target add x86_64-unknown-linux-musl
RUN apt update && \
apt install -y musl-tools musl-dev clang pkg-config lld
COPY . .
RUN cargo fetch && \
cargo build --release --bin dsa-server --target x86_64-unknown-linux-musl && \
cp /app/target/x86_64-unknown-linux-musl/release/dsa-server /usr/local/bin/dsa-server
FROM node:latest AS frontend
WORKDIR /app
COPY ./web .
RUN npm install && \
npm run build && \
mkdir -p /var/www/html && \
cp /app/dist/. /var/www/html -r
FROM alpine:latest
WORKDIR /app
COPY --from=backend /usr/local/bin/dsa-server ./dsa-server
COPY --from=frontend /var/www/html ./dist
COPY ./resources ./resources
EXPOSE 8889
CMD ["./dsa-server"]