Skip to content

Commit

Permalink
Containerize application using Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorLop committed Feb 3, 2024
1 parent 1100939 commit 1fe5bad
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Dockerfile
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Builder stage
FROM rust:1.75.0 as builder

WORKDIR /app

COPY . .

EXPOSE 3000

RUN cargo build --release

# Runtime stage
FROM rust:1.75.0-slim as runtime

WORKDIR /app

# Copy the binary created in the "Builder" stage
COPY --from=builder /app/target/release/fund-simulator-rs fund-simulator-rs

ENTRYPOINT ["./fund-simulator-rs", "--mode", "server"]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.8"

services:
web:
build: .
image: fundsimulatorrs
ports:
- "3000:3000"

0 comments on commit 1fe5bad

Please sign in to comment.