1
0
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:
monsterkrampe 2022-08-31 15:59:42 +02:00
parent b773410c50
commit 08dbd3d4e7
No known key found for this signature in database
GPG Key ID: B8ADC1F5A5CE5057
2 changed files with 38 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
frontend/node_modules
frontend/.parcel-cache
target/debug

34
Dockerfile Normal file
View 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"]