This commit is contained in:
cupcakearmy 2021-03-17 00:13:50 +01:00
commit 53855e45be
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
5 changed files with 49 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM python:3.9
RUN apt update
RUN apt install -y apache2-utils
RUN python3 -m pip install --upgrade radicale[bcrypt]
WORKDIR /app
COPY ./config /etc/radicale/config
COPY ./entrypoint.sh .
ENV USER_FILE=/data/users
VOLUME [ "/data" ]
CMD [ "/app/entrypoint.sh" ]

11
config Normal file
View File

@ -0,0 +1,11 @@
[server]
hosts = 0.0.0.0:5232
ssl = False
[auth]
type = htpasswd
htpasswd_filename = /data/users
htpasswd_encryption = bcrypt
[storage]
filesystem_folder = /data/data

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3.7'
services:
app:
build: .
env_file: .env
ports:
- 80:5232

12
entrypoint.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ ! -f "$USER_FILE" ]; then
echo "No auth file found. Generating";
DIR=$(dirname $USER_FILE)
mkdir -p $DIR
htpasswd -bB -c $USER_FILE $USER $PASSWORD;
echo "Done";
fi
echo "Starting Server";
python -u -m radicale;