feat: add container
This commit is contained in:
18
Containerfile
Normal file
18
Containerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM docker.io/rust:1.90 AS build
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
RUN cargo build --release
|
||||
|
||||
# FROM docker.io/alpine:3.22.1 AS production
|
||||
FROM docker.io/debian:sid AS production
|
||||
COPY --from=build /app/target/release/piperun-bot /app/
|
||||
COPY crontab /app/
|
||||
|
||||
WORKDIR /app
|
||||
RUN ln -sf /bin/bash /bin/sh
|
||||
RUN mkdir log
|
||||
RUN chmod +x piperun-bot
|
||||
RUN apt update && apt install cron -y
|
||||
RUN /usr/bin/crontab crontab
|
||||
|
||||
CMD ["cron", "-f"]
|
||||
24
compose.yaml
Normal file
24
compose.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
version: "3.9"
|
||||
|
||||
networks:
|
||||
piperun_bot_default:
|
||||
external: true
|
||||
ipv6_enabled: true
|
||||
|
||||
services:
|
||||
piperun-bot:
|
||||
name: piperun-bot
|
||||
restart: always
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Containerfile
|
||||
volumes:
|
||||
- ./crontab:/app/crontab:ro
|
||||
- ./PROMPT.txt:/app/PROMPT.txt
|
||||
- ./FILTER.txt:/app/FILTER.txt
|
||||
- ./evaluations:/app/evaluations
|
||||
- ./.env:/app/.env
|
||||
- ./log/container:/app/log
|
||||
- /etc/localtime:/etc/localtime:ro # sync time between machine and container
|
||||
networks:
|
||||
- piperun_bot_default
|
||||
Reference in New Issue
Block a user