Add dockerfile

This commit is contained in:
Ethan O'Brien 2024-07-03 12:27:21 -05:00
parent ec8aad5fde
commit a5c5d356bf
2 changed files with 41 additions and 0 deletions

26
docker/Dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM docker.io/library/debian:latest
RUN apt update && apt install -y curl npm libssl-dev perl git
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash
RUN apt update && apt install -y nodejs
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain stable --profile minimal
RUN git clone https://github.com/ethanaobrien/ew.git
WORKDIR /ew/webui/
RUN npm i && npm run build
WORKDIR /ew/
RUN . "$HOME/.cargo/env" && cargo build --release
RUN mkdir /root/ew/ && cp target/release/ew /root/ew/ew
RUN echo "#!/bin/bash\n\n /root/ew/ew --path \"\${DIRECTORY:-/data/}\" --port \"\${PORT:-8080}\"" > /root/ew/start.sh
RUN chmod +x /root/ew/start.sh
WORKDIR /
RUN rm -rf /ew/
ENTRYPOINT ["/root/ew/start.sh"]

15
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,15 @@
version: '3'
services:
sif2-ew:
image: sif2-ew:latest
container_name: sif2-ew
build:
dockerfile: "./Dockerfile"
environment:
PORT: 8081
DIRECTORY: /data
ports:
- 8081:8081
volumes:
- ./data:/data
restart: unless-stopped