Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Inacio authored and Gustavo Inacio committed Aug 11, 2023
1 parent 3916bb7 commit c91f64d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git/
devel/
.envrc
target/
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM rust:1.71.0-alpine as app

WORKDIR /app

RUN apk add openssl-dev musl-dev musl g++
COPY . /app

RUN \
--mount=type=cache,target=/app/target,rw \
--mount=type=cache,target=/usr/local/cargo/registry,rw \
cargo build --release && \
cp /app/target/release/elric-rs /app/elric-rs


FROM alpine:3.17.3

RUN mkdir /app

RUN apk add libc6-compat

COPY --from=app /app/elric-rs /app/elric-rs

WORKDIR /app

ENTRYPOINT ["./elric-rs"]
EXPOSE 3000
ENV RUST_LOG="info"
ENV PORT="3000"

0 comments on commit c91f64d

Please sign in to comment.