http_request action working nicely
This commit is contained in:
@@ -123,6 +123,17 @@ COPY migrations/ ./migrations/
|
||||
# Copy the common crate (almost all services depend on this)
|
||||
COPY crates/common/ ./crates/common/
|
||||
|
||||
# Build the specified service
|
||||
# The cargo registry and git cache are pre-populated from the planner stage
|
||||
# Only the actual compilation happens here
|
||||
# - registry/git use sharing=shared (concurrent builds of different services are safe)
|
||||
# - target uses service-specific cache ID (each service compiles different crates)
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
|
||||
--mount=type=cache,target=/usr/local/cargo/git,sharing=shared \
|
||||
--mount=type=cache,target=/build/target,sharing=locked \
|
||||
cargo build --release --lib -p attune-common
|
||||
|
||||
|
||||
# Build argument to specify which service to build
|
||||
ARG SERVICE=api
|
||||
|
||||
@@ -137,7 +148,7 @@ COPY crates/${SERVICE}/ ./crates/${SERVICE}/
|
||||
# - target uses service-specific cache ID (each service compiles different crates)
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
|
||||
--mount=type=cache,target=/usr/local/cargo/git,sharing=shared \
|
||||
--mount=type=cache,target=/build/target,id=target-builder-${SERVICE} \
|
||||
--mount=type=cache,target=/build/target,sharing=shared \
|
||||
cargo build --release --bin attune-${SERVICE} && \
|
||||
cp /build/target/release/attune-${SERVICE} /build/attune-service-binary
|
||||
|
||||
@@ -164,9 +175,9 @@ WORKDIR /opt/attune
|
||||
# Copy the service binary from builder
|
||||
COPY --from=builder /build/attune-service-binary /usr/local/bin/attune-service
|
||||
|
||||
# Copy configuration files
|
||||
COPY config.production.yaml ./config.yaml
|
||||
COPY config.docker.yaml ./config.docker.yaml
|
||||
# Copy configuration file for Docker Compose development
|
||||
# In production, mount config files as a volume instead of baking them into the image
|
||||
COPY config.docker.yaml ./config.yaml
|
||||
|
||||
# Copy migrations for services that need them
|
||||
COPY migrations/ ./migrations/
|
||||
@@ -184,7 +195,7 @@ USER attune
|
||||
|
||||
# Environment variables (can be overridden at runtime)
|
||||
ENV RUST_LOG=info
|
||||
ENV ATTUNE_CONFIG=/opt/attune/config.docker.yaml
|
||||
ENV ATTUNE_CONFIG=/opt/attune/config.yaml
|
||||
|
||||
# Health check (will be overridden per service in docker-compose)
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
||||
|
||||
Reference in New Issue
Block a user