mirror of
https://github.com/amigan/rustypaste-pretty.git
synced 2024-11-21 20:09:48 -05:00
chore(docker): add Dockerfile
This commit is contained in:
parent
97f47a5a42
commit
763b956a17
2 changed files with 31 additions and 0 deletions
10
.dockerignore
Normal file
10
.dockerignore
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Directories
|
||||
/.git/
|
||||
/.github/
|
||||
/target/
|
||||
/upload/
|
||||
|
||||
# Files
|
||||
.gitignore
|
||||
*.md
|
||||
LICENSE
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
FROM ekidd/rust-musl-builder:latest as builder
|
||||
WORKDIR /home/rust/src
|
||||
COPY Cargo.toml Cargo.toml
|
||||
RUN mkdir -p src/
|
||||
RUN echo "fn main() {println!(\"failed to build\")}" > src/main.rs
|
||||
RUN cargo build --release
|
||||
RUN rm -f target/release/deps/rustypaste*
|
||||
COPY . .
|
||||
RUN cargo build --locked --release
|
||||
RUN mkdir -p build-out/
|
||||
RUN cp target/x86_64-unknown-linux-musl/release/rustypaste build-out/
|
||||
|
||||
FROM scratch
|
||||
WORKDIR /app
|
||||
COPY --from=builder \
|
||||
/home/rust/src/build-out/rustypaste \
|
||||
/home/rust/src/config.toml ./
|
||||
ENV SERVER__ADDRESS=0.0.0.0:8000
|
||||
EXPOSE 8000
|
||||
USER 1000:1000
|
||||
CMD ["./rustypaste"]
|
Loading…
Reference in a new issue