-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (28 loc) · 1015 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
35
36
37
38
39
FROM rust:1.83.0 AS builder
WORKDIR /tmp
COPY Cargo.toml Cargo.lock /tmp/
COPY meme_generator /tmp/meme_generator
COPY meme_generator_cli /tmp/meme_generator_cli
COPY meme_generator_core /tmp/meme_generator_core
COPY meme_generator_memes /tmp/meme_generator_memes
COPY meme_generator_py /tmp/meme_generator_py
COPY meme_generator_server /tmp/meme_generator_server
COPY meme_generator_utils /tmp/meme_generator_utils
COPY meme_options_derive /tmp/meme_options_derive
RUN export MEME_IMAGES_DIR=/app/resources/images \
&& cargo build --release --bin server
FROM debian:bookworm-slim AS app
EXPOSE 2233
ENV TZ=Asia/Shanghai \
MEME_HOME=/data \
RUST_LOG=info
VOLUME /data
WORKDIR /app
COPY --from=builder /tmp/target/release/server /app/server
COPY resources/images /app/resources/images/
COPY resources/fonts /usr/share/fonts/meme-fonts/
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssl fontconfig \
&& fc-cache -fv \
&& rm -rf /var/lib/apt/lists/*
CMD ["/app/server"]