Skip to content

Commit

Permalink
Fix Server's docker-test but building Organizer. Disable Cargo Chef.
Browse files Browse the repository at this point in the history
  • Loading branch information
elonen committed May 10, 2024
1 parent c6bb219 commit a1ffe83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN useradd -m ${USER} --uid=${UID} --gid=${GID} || true

# Install cargo chef (Rust build cache for Docker)
USER ${UID}:${GID}
RUN cargo install cargo-chef
# RUN cargo install cargo-chef
RUN cargo install cargo-deb
USER root

Expand All @@ -36,6 +36,7 @@ RUN apt-get -qy install sqlite3 >/dev/null
RUN apt-get -qy install libssl-dev >/dev/null
RUN apt-get -qy install libsqlite3-dev >/dev/null
RUN apt-get -qy install protobuf-compiler >/dev/null
RUN apt-get -qy install python3.11-venv >/dev/null

# Switch to regular user
RUN mkdir -p /app
Expand All @@ -48,30 +49,31 @@ FROM chef AS planner

RUN mkdir -p /app/server
WORKDIR /app/server
COPY --chown=${UID}:${GID} server/Cargo.toml .
RUN cargo chef prepare --recipe-path recipe.json

RUN mkdir -p /app/protobuf/libs/rust
WORKDIR /app/protobuf/libs/rust
COPY --chown=${UID}:${GID} ../protobuf/libs/rust/Cargo.toml .
RUN cargo chef prepare --recipe-path recipe.json
# COPY --chown=${UID}:${GID} server/Cargo.toml .
# RUN cargo chef prepare --recipe-path recipe.json
#
# RUN mkdir -p /app/protobuf/libs/rust
# WORKDIR /app/protobuf/libs/rust
# COPY --chown=${UID}:${GID} ../protobuf/libs/rust/Cargo.toml .
# RUN cargo chef prepare --recipe-path recipe.json

# ----------------------------------

FROM chef AS builder

# Prebuild dependencies (build cache)
WORKDIR /app/protobuf/libs/rust
COPY --from=planner /app/protobuf/libs/rust/recipe.json ./
RUN cargo chef cook --recipe-path recipe.json
# COPY --from=planner /app/protobuf/libs/rust/recipe.json ./
# RUN cargo chef cook --recipe-path recipe.json

WORKDIR /app/server
COPY --from=planner /app/server/recipe.json ./
RUN cargo chef cook --recipe-path recipe.json
# COPY --from=planner /app/server/recipe.json ./
# RUN cargo chef cook --recipe-path recipe.json

# Copy dep sources
COPY --chown=${UID}:${GID} protobuf/proto /app/protobuf/proto
COPY --chown=${UID}:${GID} protobuf/libs/rust /app/protobuf/libs/rust
COPY --chown=${UID}:${GID} protobuf /app/protobuf
COPY --chown=${UID}:${GID} organizer /app/organizer
COPY --chown=${UID}:${GID} server /app/server

# -- config entrypoint --
Expand Down
1 change: 1 addition & 0 deletions server/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.PHONY: deps clean test docker test run run-local run-docker default debian-local
SHELL := /bin/bash

PLUGIN_BIN=../organizer/basic_folders/run-py-org.sh

Expand Down

0 comments on commit a1ffe83

Please sign in to comment.