Skip to content

Commit 1c0e009

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

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
RUN ls
9+
10+
FROM ubuntu:latest
11+
RUN apt-get update && apt-get install -y libssl-dev pkg-config
12+
RUN apt-get install -y ca-certificates
13+
14+
WORKDIR /app
15+
COPY --from=builder /app/target/release/server /usr/local/bin
16+
ENV SERVER_ADDRESS=0.0.0.0
17+
ENV SERVER_PORT=3000
18+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
19+
RUN source $HOME/.cargo/env
20+
ENTRYPOINT ["/usr/local/bin/server"]
21+

0 commit comments

Comments
 (0)