Skip to content

Commit 7fa6876

Browse files
committed
Add dockerfile to run on railway
1 parent 24ccd1d commit 7fa6876

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM rust:1.71 as builder
2+
ENV SERVER_ADDRESS=0.0.0.0
3+
ENV SERVER_PORT=3000
4+
WORKDIR /app
5+
COPY . .
6+
7+
RUN cargo build --release --target=x86_64-unknown-linux-gnu
8+
FROM ubuntu:latest
9+
RUN apt-get update && apt-get install -y libssl-dev pkg-config
10+
RUN apt-get install -y ca-certificates
11+
12+
WORKDIR /app
13+
COPY --from=builder /app/target/release/server /usr/local/bin
14+
ENV SERVER_ADDRESS=0.0.0.0
15+
ENV SERVER_PORT=3000
16+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
17+
RUN source $HOME/.cargo/env
18+
ENTRYPOINT ["/usr/local/bin/server"]
19+

0 commit comments

Comments
 (0)