FROM rust as builder

WORKDIR /build
COPY . .

RUN pwd
RUN ls

RUN cargo build --release
RUN pwd
RUN ls

FROM debian

WORKDIR /root
COPY --from=builder /build/target/release/application ./
COPY ./templates/ ./
RUN mkdir templates && mv index.html templates/

ENV PORT=''
ENV DATABASE_URL=''

CMD ["./application"]
