mirror of https://github.com/buster-so/buster.git
docker optimizations
This commit is contained in:
parent
18dc3dc5dd
commit
1f6b2e4508
|
@ -0,0 +1,41 @@
|
||||||
|
# Git
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Rust
|
||||||
|
target/
|
||||||
|
**/*.rs.bk
|
||||||
|
Cargo.lock
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# Debug files
|
||||||
|
*.pdb
|
||||||
|
*.dSYM/
|
||||||
|
|
||||||
|
# Test files
|
||||||
|
tests/
|
||||||
|
*.test
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
docs/
|
||||||
|
*.md
|
||||||
|
!README.md
|
||||||
|
|
||||||
|
# Development configs
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
*.log
|
||||||
|
.DS_Store
|
|
@ -9,7 +9,8 @@ FROM chef AS builder
|
||||||
COPY --from=planner /app/recipe.json recipe.json
|
COPY --from=planner /app/recipe.json recipe.json
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo build --release --bin bi_api
|
# Add optimization flags for maximum performance
|
||||||
|
RUN RUSTFLAGS="-C target-cpu=native -C opt-level=3" cargo build --release --bin bi_api
|
||||||
|
|
||||||
FROM debian:bookworm-slim AS runtime
|
FROM debian:bookworm-slim AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -30,6 +31,10 @@ COPY cert.pem* /usr/local/share/ca-certificates/cert.crt
|
||||||
COPY cert.pem* /root/.postgresql/root.crt
|
COPY cert.pem* /root/.postgresql/root.crt
|
||||||
RUN update-ca-certificates
|
RUN update-ca-certificates
|
||||||
|
|
||||||
|
# Set production environment variables
|
||||||
|
ENV RUST_LOG=warn
|
||||||
|
ENV RUST_BACKTRACE=0
|
||||||
|
|
||||||
COPY --from=builder /app/target/release/bi_api .
|
COPY --from=builder /app/target/release/bi_api .
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
ENTRYPOINT ["./bi_api"]
|
ENTRYPOINT ["./bi_api"]
|
||||||
|
|
Loading…
Reference in New Issue