-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (22 loc) · 825 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM rust:1.55 as builder
WORKDIR /usr/src/rustfuif
ENV SQLX_OFFLINE="true"
COPY Cargo.toml Cargo.lock sqlx-data.json ./
COPY migrations ./migrations
COPY src ./src
RUN cargo build --release
RUN cargo install --version=0.5.9 sqlx-cli --no-default-features --features postgres
FROM debian:bullseye-slim
WORKDIR /usr/src/rustfuif
# curl is used for docker-compose health checks
RUN apt-get update && \
apt-get install curl ca-certificates -y --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY ./migrations ./migrations
COPY --from=builder /usr/local/cargo/bin/sqlx /usr/bin/sqlx
COPY --from=builder /usr/src/rustfuif/target/release/rustfuif /usr/bin/rustfuif
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "rustfuif" ]