tuxman/deployments/docker/Dockerfile
2023-06-29 11:54:24 -04:00

23 lines
507 B
Docker

FROM rust:alpine AS builder-rs
COPY server/Cargo.toml server/Cargo.lock /app/
COPY server/src /app/src
WORKDIR /app
RUN apk add musl-dev
RUN cargo build --release
FROM node:alpine AS builder-ts
COPY client /app/
WORKDIR /app
RUN npm install typescript
RUN npx tsc
FROM alpine
RUN apk add --no-cache tini
RUN adduser -DH block
USER block
COPY --from=builder-rs /app/target/release/rollback /rollback
COPY --from=builder-ts /app /client
ENV CLIENT_DIR=/client
ENTRYPOINT ["/sbin/tini", "--", "/rollback"]