datatrash/Dockerfile

31 lines
674 B
Docker
Raw Normal View History

2022-02-27 01:15:46 +00:00
FROM rust:alpine as builder
WORKDIR /app
RUN apk add musl-dev
RUN cargo init
COPY Cargo.toml Cargo.lock ./
RUN cargo build --release --target=x86_64-unknown-linux-musl
COPY src ./src
COPY static ./static
COPY template ./template
COPY snippet ./snippet
COPY init-db.sql ./init-db.sql
2022-10-07 13:52:26 +00:00
COPY mime.types ./mime.types
RUN touch src/main.rs
RUN cargo build --release --target=x86_64-unknown-linux-musl
RUN strip /app/target/x86_64-unknown-linux-musl/release/datatrash
2022-02-27 01:15:46 +00:00
FROM alpine
WORKDIR /opt/datatrash
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/datatrash ./
COPY static ./static
RUN mkdir ./files
EXPOSE 8000
ENTRYPOINT ["/opt/datatrash/datatrash"]