-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
46 lines (34 loc) · 1.11 KB
/
Dockerfile
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
# Build stage
FROM rust:slim-bookworm AS builder
# Install system dependencies for OpenSSL and pkg-config
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
curl \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Install dioxus-cli
RUN cargo install --git https://github.com/DioxusLabs/dioxus dioxus-cli --locked
# Set the working directory
WORKDIR /usr/src/app
# Copy the entire project
COPY . .
# Tailwind 💨
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css
# Build the project
RUN dx build --release
# Final stage
FROM debian:bookworm-slim
# Install necessary dependencies for running the server
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy the entire web directory from the builder stage
COPY --from=builder /usr/src/app/target/dx/DrawsNotes/release/web ./
ENV PORT=8080
ENV IP=0.0.0.0
# Expose the port your server listens on (adjust if necessary)
EXPOSE 8080
# Run the server
CMD ["./server"]