-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (32 loc) · 794 Bytes
/
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 ubuntu:latest as builder
# Setup
RUN apt-get -y update && apt-get -y install build-essential curl pkg-config clang
# Install Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
COPY ./ ./usr/src/app
WORKDIR /usr/src/app
# Build the rust project
RUN cargo build --release
#
#
# Host Stage
#
FROM ubuntu
# Install deps
RUN apt-get -y update && apt-get -y install curl unzip
# Download and install Bun
RUN curl -fsSL https://bun.sh/install | bash
# Add Bun to PATH
ENV PATH="/root/.bun/bin:$PATH"
# Copy in bun app
COPY ./site ./usr/local/bin
# Copy in rust app
COPY --from=builder /usr/src/app/target/release/auto-js-doc /usr/local/bin
WORKDIR /usr/local/bin
EXPOSE 3000
# Run bun server
CMD ["bun", "run", "index.ts"]