Create a Docker image based on Alpine for board-server
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1fc4e10c39
commit
abf902c80e
@ -0,0 +1,23 @@
|
|||||||
|
FROM rust:1.68.0-slim as builder
|
||||||
|
|
||||||
|
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
||||||
|
WORKDIR /usr/src/board
|
||||||
|
|
||||||
|
COPY Cargo.toml /usr/src/board/Cargo.toml
|
||||||
|
COPY board-frontend /usr/src/board/board-frontend
|
||||||
|
COPY board-network /usr/src/board/board-network
|
||||||
|
COPY board-server /usr/src/board/board-server
|
||||||
|
COPY board-shared /usr/src/board/board-shared
|
||||||
|
|
||||||
|
# Build with musl to run on Alpine
|
||||||
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
RUN cargo build --target x86_64-unknown-linux-musl --release --bin board-server
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:3.17.2 AS runtime
|
||||||
|
|
||||||
|
COPY --from=builder /usr/src/board/target/x86_64-unknown-linux-musl/release/board-server /usr/local/bin
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/board-server"]
|
@ -0,0 +1,23 @@
|
|||||||
|
version: '3.0'
|
||||||
|
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: board-server/Dockerfile
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
networks:
|
||||||
|
- db-network
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
networks:
|
||||||
|
- db-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
db-network:
|
||||||
|
driver: bridge
|
Loading…
Reference in new issue