-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (34 loc) · 1008 Bytes
/
Dockerfile
File metadata and controls
48 lines (34 loc) · 1008 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM rust:slim-bullseye AS builder
# Set the working directory
WORKDIR /app
# Install dependencies
RUN apt-get update
RUN apt-get install -y build-essential musl-dev musl-tools pkgconf
# Copy dependency files
COPY backend/Cargo.toml backend/Cargo.lock ./
# Copy source code
COPY backend/src ./src
COPY metaploy ./metaploy
COPY backend/.sqlx ./.sqlx
COPY backend/migrations ./migrations
# For static build
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --target=x86_64-unknown-linux-musl --release
FROM alpine:latest AS app
# Install runtime dependencies correctly with apk
RUN apk add --no-cache \
ca-certificates \
tzdata \
bash \
poppler-utils \
nginx
ENV TZ="Asia/Kolkata"
WORKDIR /app
# Copy metaploy files
COPY metaploy ./
# Make postinstall script executable
RUN chmod +x ./postinstall.sh
EXPOSE 8085
# Copy frontend build from the previous stage
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/backend .
CMD ["./postinstall.sh", "./backend"]