A cup of Docker

This commit is contained in:
Shiroyasha 2024-05-24 21:40:02 +03:00
parent 2b5258d551
commit 13702a94c0
Signed by: shiroyashik
GPG key ID: E4953D3940D7860A
2 changed files with 38 additions and 0 deletions

21
Dockerfile Normal file
View file

@ -0,0 +1,21 @@
FROM rust:1.78.0-alpine3.20 as builder
WORKDIR /build
RUN apk add musl-dev libressl-dev
COPY Cargo.toml Cargo.lock ./
COPY src src
RUN cargo build --release
FROM alpine:3.20.0
WORKDIR /app
COPY --from=builder /build/target/release/sculptor /app/sculptor
VOLUME [ "/app/avatars" ]
EXPOSE 6665/tcp
CMD ["./sculptor"]

17
docker-compose.yml Normal file
View file

@ -0,0 +1,17 @@
name: sculptor
services:
sculptor:
build: .
container_name: sculptor
restart: unless-stopped
volumes:
- ./Config.toml:/app/Config.toml:ro
- ./avatars:/app/avatars
## Recommended for use with reverse proxy.
# labels:
# - traefik.enable=true
# - traefik.http.routers.sculptor.rule=Host(`mc.example.com`)
# - traefik.http.routers.sculptor.entrypoints=websecure, web
# - traefik.http.routers.sculptor.tls=true
# - traefik.http.routers.sculptor.tls.certresolver=production