forked from tursodatabase/libsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
39 lines (29 loc) · 972 Bytes
/
Dockerfile.dev
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
35
36
37
38
39
# build sqld
FROM rust:slim-bullseye as builder
RUN apt update
RUN apt install -y libclang-dev clang \
build-essential tcl protobuf-compiler file \
libssl-dev pkg-config
RUN apt clean
RUN update-ca-certificates
WORKDIR /sqld
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/sqld/target \
cargo build -p libsql-server --release && \
cp target/release/sqld /sqld/bin
# runtime
FROM debian:bullseye-slim
RUN apt update
COPY --from=builder /sqld/bin /bin/sqld
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY docker-entrypoint.sh /usr/local/bin
VOLUME [ "/var/lib/sqld" ]
RUN groupadd --system --gid 666 sqld
RUN adduser --system --home /var/lib/sqld --uid 666 --gid 666 sqld
USER sqld
WORKDIR /var/lib/sqld
EXPOSE 5001 8080
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/bin/sqld"]