-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
22 lines (20 loc) · 1.17 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM fedora:36 AS builder
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN dnf install gcc openssl-devel -y
RUN source $HOME/.cargo/env && cargo install --locked trunk && rustup target add wasm32-unknown-unknown
RUN mkdir -p /opt/podcast-player
COPY podcast-player-api /opt/podcast-player/podcast-player-api
COPY podcast-player-common /opt/podcast-player/podcast-player-common
COPY podcast-player-pwa /opt/podcast-player/podcast-player-pwa
COPY Cargo.* /opt/podcast-player/
COPY nginx.conf /opt/podcast-player/nginx.conf
RUN source $HOME/.cargo/env && cd /opt/podcast-player/podcast-player-pwa && trunk build --release
RUN source $HOME/.cargo/env && cd /opt/podcast-player && cargo build --release -p podcast-player-api
FROM nginx:stable-alpine AS pwa
MAINTAINER Hannes Hochreiner <hannes@hochreiner.net>
COPY --from=builder /opt/podcast-player/podcast-player-pwa/dist /usr/share/nginx/html
COPY --from=builder /opt/podcast-player/nginx.conf /etc/nginx/nginx.conf
FROM fedora:36 AS api
MAINTAINER Hannes Hochreiner <hannes@hochreiner.net>
COPY --from=builder /opt/podcast-player/target/release/rss-json-service /opt/podcast-player-api
CMD ["/opt/podcast-player-api"]