Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN apt-get -q update && \
apt-get -q update ; \
fi; \
fi && \
if [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
if [ "$SYNCSTORAGE_DATABASE_BACKEND" = "postgres" ] || [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
POSTGRES_DEV_PKG="libpq-dev"; \
fi && \
apt-get -q install -y --no-install-recommends $MYSQL_PKG $POSTGRES_DEV_PKG cmake python3-dev python3-pip python3-setuptools python3-wheel python3-venv pkg-config && \
Expand All @@ -45,11 +45,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
--mount=type=cache,target=/app/target,sharing=locked \
set -x && \
TOKENSERVER_FEATURES="" && \
if [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
TOKENSERVER_FEATURES="--features=tokenserver-db/postgres"; \
fi && \
cargo chef cook --release --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND $TOKENSERVER_FEATURES --features=py_verifier --recipe-path recipe.json
cargo chef cook --release --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND --features=tokenserver-db/$TOKENSERVER_DATABASE_BACKEND --features=py_verifier --recipe-path recipe.json

ENV POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
Expand Down Expand Up @@ -96,13 +92,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
--mount=type=cache,target=/app/target,sharing=locked \
set -x && \
TOKENSERVER_FEATURES="" && \
if [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
TOKENSERVER_FEATURES="--features=tokenserver-db/postgres"; \
fi && \
cargo --version && \
rustc --version && \
cargo install --path ./syncserver --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND $TOKENSERVER_FEATURES --features=py_verifier --locked --root /app
cargo install --path ./syncserver --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND --features=tokenserver-db/$TOKENSERVER_DATABASE_BACKEND --features=py_verifier --locked --root /app

FROM docker.io/library/debian:bookworm-slim
ARG SYNCSTORAGE_DATABASE_BACKEND
Expand Down
6 changes: 3 additions & 3 deletions syncserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ slog-journald = "2.2.0"
default = ["mysql", "py_verifier"]
no_auth = []
py_verifier = ["tokenserver-auth/py", "tokenserver-common/py"]
mysql = ["syncstorage-db/mysql"]
postgres = ["syncstorage-db/postgres"]
spanner = ["syncstorage-db/spanner"]
mysql = ["syncstorage-db/mysql", "tokenserver-db/mysql"]
postgres = ["syncstorage-db/postgres", "tokenserver-db/postgres"]
spanner = ["syncstorage-db/spanner", "tokenserver-db/mysql"]
actix-compress = ["actix-web/compress-brotli", "actix-web/compress-gzip", "actix-web/compress-zstd"]
1 change: 0 additions & 1 deletion tokenserver-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ temp-env.workspace = true
syncserver-settings = { path = "../syncserver-settings" }

[features]
default = ["mysql"]
mysql = ['tokenserver-mysql']
postgres = ['tokenserver-postgres']
Loading