-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (27 loc) · 809 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
# Docker image for compiling the server
FROM rust:1.65.0 as builder
# Set working directory to app
WORKDIR /app
# Copying all files to our work directory
COPY . .
# Building the binary
RUN cargo build --release
# Docker image for running the server
FROM debian:bullseye-slim as runtime
ARG PORT
# Set working directory to app
WORKDIR /app
# Copying the compiled binary
COPY --from=builder /app/target/release/dinoly dinoly
#Copying configuration
COPY config config
RUN apt-get update -y\
&& apt-get install -y --no-install-recommends openssl ca-certificates\
&& apt-get autoremove\
&& apt-get clean -y\
&& rm -rf /var/lib/apt/lists/*
# Setting environment variable to production mode
ENV ENVIRONMENT production
ENV RUST_LOG debug
# Entrypoint to our binary
ENTRYPOINT ["./dinoly"]