forked from github-mirrorer/taskchampion-sync-server
Finish building Postgres support (#133)
This includes: - Building a Docker image for Postgres as well as SQLite - Fuller instructions for usage of the package, including the Postgres builds. A few related things changed here: - `.env` is not used anymore -- the defaults in the Dockerfiles are sufficient - The Rust version in the Dockerfiles is increased to match the MSRV, and with it the Alpine version bumped to one built with that Rust version. - Cargo dependencies on native-tls and openssl updated to include only the `vendored` feature, so as not to require a system openssl installation. - Two GitHub jobs are set up, to build the two different Docker images - The documentation incorrectly suggested using `DELETE .. CASCADE` to delete clients. This syntax does not exist, as the cascading delete is configured in the schema.
This commit is contained in:
committed by
GitHub
parent
820aaf363c
commit
ab6df362bf
26
Dockerfile-sqlite
Normal file
26
Dockerfile-sqlite
Normal file
@ -0,0 +1,26 @@
|
||||
# Versions must be major.minor
|
||||
# Default versions are as below
|
||||
ARG RUST_VERSION=1.85
|
||||
ARG ALPINE_VERSION=3.20
|
||||
|
||||
FROM docker.io/rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS builder
|
||||
RUN apk -U add libc-dev
|
||||
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 --release --bin taskchampion-sync-server
|
||||
|
||||
FROM docker.io/alpine:${ALPINE_VERSION}
|
||||
COPY --from=builder /data/target/release/taskchampion-sync-server /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
|
||||
VOLUME /var/lib/taskchampion-sync-server/data
|
||||
COPY entrypoint-sqlite.sh /bin/entrypoint.sh
|
||||
ENTRYPOINT [ "/bin/entrypoint.sh" ]
|
||||
CMD [ "/bin/taskchampion-sync-server" ]
|
||||
Reference in New Issue
Block a user