mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Update docker to be better
This commit is contained in:
parent
18c5524ce2
commit
fbda01a5fe
3 changed files with 13 additions and 2 deletions
|
@ -15,7 +15,7 @@ WORKDIR /ew/
|
||||||
RUN . "$HOME/.cargo/env" && cargo build --release
|
RUN . "$HOME/.cargo/env" && cargo build --release
|
||||||
RUN mkdir /root/ew/ && cp target/release/ew /root/ew/ew
|
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
|
COPY ./start.sh /root/ew/start.sh
|
||||||
|
|
||||||
RUN chmod +x /root/ew/start.sh
|
RUN chmod +x /root/ew/start.sh
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ services:
|
||||||
dockerfile: "./Dockerfile"
|
dockerfile: "./Dockerfile"
|
||||||
environment:
|
environment:
|
||||||
PORT: 8081
|
PORT: 8081
|
||||||
DIRECTORY: /data
|
DIRECTORY: /data/
|
||||||
|
HTTPS: false
|
||||||
ports:
|
ports:
|
||||||
- 8081:8081
|
- 8081:8081
|
||||||
volumes:
|
volumes:
|
||||||
|
|
10
docker/start.sh
Normal file
10
docker/start.sh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
port="${PORT:-8080}"
|
||||||
|
directory="${DIRECTORY:-/data/}"
|
||||||
|
|
||||||
|
if [ "$HTTPS" = "true" ]; then
|
||||||
|
/root/ew/ew --path $directory --port $port --https
|
||||||
|
else
|
||||||
|
/root/ew/ew --path $directory --port $port
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue