forked from africinnovate/health-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
33 lines (24 loc) · 895 Bytes
/
Dockerfile.dev
File metadata and controls
33 lines (24 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM rust:1.86
# Install cargo-watch for hot-reloading
RUN cargo install cargo-watch --locked
# Install PostgreSQL client
RUN apt-get update && apt-get install -y \
postgresql-client \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy manifests first for dependency caching
COPY Cargo.toml Cargo.lock ./
# Create dummy main to cache dependencies
RUN mkdir -p src && \
echo "fn main() {println!(\"Dummy\");}" > src/main.rs && \
cargo build --release && \
rm -rf src target/release/deps/emr_api* target/release/emr-api*
# Copy the actual source code (will be mounted as volume in docker-compose)
COPY src ./src
COPY migrations ./migrations
# Create a development startup script
COPY scripts/docker-entrypoint-dev.sh /app/docker-entrypoint-dev.sh
RUN chmod +x /app/docker-entrypoint-dev.sh
EXPOSE 8080
ENTRYPOINT ["/app/docker-entrypoint-dev.sh"]