forked from github-mirrorer/taskchampion-sync-server
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
# Versions must be major.minor
|
|
# Default versions are as below
|
|
# RUST_VERSION should match the MSRV in Cargo.toml.
|
|
ARG RUST_VERSION=1.88
|
|
ARG ALPINE_VERSION=3.20
|
|
|
|
FROM docker.io/rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS builder
|
|
# perl and make are required to build openssl.
|
|
RUN apk -U add libc-dev perl make
|
|
COPY Cargo.lock Cargo.toml /data/
|
|
COPY core /data/core/
|
|
COPY server /data/server/
|
|
COPY postgres /data/postgres/
|
|
COPY sqlite /data/sqlite/
|
|
RUN cd /data && \
|
|
cargo build -p taskchampion-sync-server --release --no-default-features --features postgres --bin taskchampion-sync-server-postgres
|
|
|
|
FROM docker.io/alpine:${ALPINE_VERSION}
|
|
COPY --from=builder /data/target/release/taskchampion-sync-server-postgres /bin
|
|
RUN apk add --no-cache su-exec && \
|
|
adduser -u 1092 -S -D -H -h /var/lib/taskchampion-sync-server -s /sbin/nologin -G users \
|
|
-g taskchampion taskchampion && \
|
|
install -d -m1755 -o1092 -g1092 "/var/lib/taskchampion-sync-server"
|
|
EXPOSE 8080
|
|
COPY entrypoint-postgres.sh /bin/entrypoint.sh
|
|
ENTRYPOINT [ "/bin/entrypoint.sh" ]
|
|
CMD [ "/bin/taskchampion-sync-server-postgres" ]
|