More preparation for running in docker
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -1,14 +1,12 @@
|
||||
FROM alpine:latest
|
||||
|
||||
# Dependencies
|
||||
RUN apk add gcompat
|
||||
RUN apk add libuuid
|
||||
|
||||
# copy users file and app binary
|
||||
COPY ./output/userctl /root/userctl
|
||||
COPY ./output/server /root/server
|
||||
# Executable files
|
||||
COPY ./output/userctl /userctl
|
||||
COPY ./output/server /server
|
||||
|
||||
RUN mkdir /books
|
||||
|
||||
# init command
|
||||
#ENTRYPOINT [ "/root/server", "5000", "/books", "ThoNohT's Library" ]
|
||||
ENTRYPOINT [ "/bin/sh" ]
|
||||
# Entrypoint
|
||||
ENTRYPOINT /server "$OFS_PORT" "$OFS_LIBRARY_PATH" "$OFS_TITLE"
|
||||
|
||||
13
build.sh
13
build.sh
@@ -31,9 +31,20 @@ elif [ $1 = "dockerbuild" ]; then
|
||||
docker image build \
|
||||
--file Dockerfile \
|
||||
--progress plain \
|
||||
--tag folder-opds-server \
|
||||
--tag thonoht/folder-opds-server \
|
||||
.
|
||||
|
||||
elif [ $1 = "dockerrun" ]; then
|
||||
docker run \
|
||||
-di \
|
||||
-e OFS_LIBRARY_PATH=/root/library \
|
||||
-e OFS_PORT=5000 \
|
||||
-e OFS_TITLE="ThoNohT's Server" \
|
||||
-v ./library:/root/library \
|
||||
-p 5000:5000 \
|
||||
--name folder-opds-server thonoht/folder-opds-server
|
||||
docker ps
|
||||
|
||||
else
|
||||
echo "Invalid command."
|
||||
|
||||
|
||||
@@ -200,6 +200,8 @@ int main(int argc, char **argv)
|
||||
// Keep the server running
|
||||
getchar();
|
||||
|
||||
noh_log(NOH_INFO, "Shutting down.", port);
|
||||
|
||||
// Stop the server
|
||||
MHD_stop_daemon(server);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user