feat(docker): add docker support with Dockerfile and docker-compose.yaml
This commit is contained in:
parent
fb2dd90181
commit
44f0b33fe5
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM rust:1.80 AS builder
|
||||
|
||||
WORKDIR /code
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
RUN cargo build --release
|
||||
|
||||
COPY src src
|
||||
RUN cargo install --path .
|
||||
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends sqlite3 libsqlite3-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /usr/local/cargo/bin/script_hoster .
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["./script_hoster"]
|
||||
|
12
docker-compose.yaml
Normal file
12
docker-compose.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
services:
|
||||
web:
|
||||
restart: unless-stopped
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./.env:/app/.env:ro
|
||||
- data:/app
|
||||
|
||||
volumes:
|
||||
data:
|
Loading…
Reference in New Issue
Block a user