mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-20 09:39:38 +01:00
Add Dockerfile as example for server with frontend
This commit is contained in:
parent
b773410c50
commit
08dbd3d4e7
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
frontend/node_modules
|
||||
frontend/.parcel-cache
|
||||
target/debug
|
||||
|
||||
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# 1. BUILD-CONTAINER: Frontend
|
||||
FROM node:gallium-alpine
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
COPY ./frontend /root
|
||||
|
||||
RUN yarn && yarn build
|
||||
|
||||
# 2. BUILD-CONTAINER: Server
|
||||
FROM rust:alpine
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
RUN apk add --no-cache musl-dev
|
||||
|
||||
COPY ./bin /root/bin
|
||||
COPY ./lib /root/lib
|
||||
COPY ./server /root/server
|
||||
COPY ./Cargo.toml /root/Cargo.toml
|
||||
COPY ./Cargo.lock /root/Cargo.lock
|
||||
|
||||
RUN cargo build --workspace --release
|
||||
|
||||
# 3. RUNTIME-CONTAINER: run server with frontend as assets
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
COPY --from=0 /root/dist /root/assets
|
||||
COPY --from=1 /root/target/release/adf-bdd-server /root/server
|
||||
|
||||
ENTRYPOINT ["./server"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user