Skip to content

Commit

Permalink
chore: update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwnewcomer committed Sep 15, 2024
1 parent 448202e commit 9aeb47e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin server
RUN cargo build --release --package yrs-relay

# We do not need the Rust toolchain to run the binary!
FROM debian:bookworm-slim AS runtime
RUN apt update -y
RUN apt install curl -y
FROM debian:stable-slim AS runtime

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY --from=builder /app/target/release/server /usr/local/bin
ENTRYPOINT ["/usr/local/bin/server"]

COPY --from=builder /app/target/release/yrs-relay /usr/local/bin

ENTRYPOINT ["/usr/local/bin/yrs-relay"]
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,34 @@ services:
depends_on:
- redis

server3:
build:
context: .
dockerfile: Dockerfile.dev # Use the development Dockerfile
volumes:
- .:/app
environment:
- NODE_ADDRESS=server3:3000
- REDIS_URL=redis://redis:6379
ports:
- "8003:3000"
depends_on:
- redis

server4:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- .:/app
environment:
- NODE_ADDRESS=server4:3000
- REDIS_URL=redis://redis:6379
ports:
- "8004:3000"
depends_on:
- redis

redis:
image: redis:alpine
ports:
Expand Down

0 comments on commit 9aeb47e

Please sign in to comment.