462c4a2954
* A first attempt at using deser-hjson. Fixes #1270 * Trying to fix tests, try 1 * Trying to fix tests, try 2 * A few fixes to deser_hjson - Removing unwrap_or_defaults, using impl functions. - Reorganized settings * Make clippy happy * hjson list strings must be quoted. * Adding support for env vars. * Moving to structs and defaults file. * Moving settings default and struct.
39 lines
955 B
Text
39 lines
955 B
Text
ARG RUST_BUILDER_IMAGE=rust:1.47-slim-buster
|
|
|
|
# Build Lemmy
|
|
FROM $RUST_BUILDER_IMAGE as builder
|
|
|
|
# Install compilation dependencies
|
|
RUN apt-get update \
|
|
&& apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./ ./
|
|
|
|
RUN cargo build --release
|
|
|
|
# reduce binary size
|
|
RUN strip ./target/release/lemmy_server
|
|
|
|
RUN cp ./target/release/lemmy_server /app/lemmy_server
|
|
|
|
# The Debian runner
|
|
FROM debian:buster-slim as lemmy
|
|
|
|
# Install libpq for postgres and espeak for captchas
|
|
RUN apt-get update \
|
|
&& apt-get -y install --no-install-recommends espeak postgresql-client libc6 libssl1.1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN addgroup --gid 1000 lemmy
|
|
RUN adduser --no-create-home --shell /bin/sh --uid 1000 --gid 1000 lemmy
|
|
|
|
# Copy resources
|
|
COPY --chown=lemmy:lemmy --from=builder /app/lemmy_server /app/lemmy
|
|
|
|
RUN chown lemmy:lemmy /app/lemmy
|
|
USER lemmy
|
|
EXPOSE 8536
|
|
CMD ["/app/lemmy"]
|