diff --git a/Dockerfile b/Dockerfile index e5533510..670db4ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,8 +40,8 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends \ # PHP php7.3 \ - # PHP SQL drivers - php7.3-sqlite3 php7.3-mysql \ + # PHP SQLite driver + php7.3-sqlite3 \ # PHP extensions php-xml php7.3-gd php7.3-mbstring \ # Nginx and PHP FPM to serve over HTTP @@ -126,14 +126,9 @@ ENV \ # nothing will get logged, ever. APP_LOG_LEVEL=notice \ # Database config & credentials - # DB_CONNECTION can be mysql + # DB_CONNECTION can only be sqlite DB_CONNECTION=sqlite \ DB_DATABASE="/srv/database/database.sqlite" \ - # if you want to use MySQL: - DB_HOST=127.0.0.1 \ - DB_PORT=3306 \ - DB_USERNAME=homestead \ - DB_PASSWORD=secret \ # If you're looking for performance improvements, you could install memcached. CACHE_DRIVER=file \ SESSION_DRIVER=file \ diff --git a/docker/README.md b/docker/README.md index b61a6266..63037c99 100644 --- a/docker/README.md +++ b/docker/README.md @@ -11,6 +11,7 @@ ## Features - Runs without root as user `www-data` - [![Latest size](https://img.shields.io/docker/image-size/2fauth/2fauth/latest?label=Image%20size)](https://hub.docker.com/r/2fauth/2fauth/tags) - Compatible with `amd64` only for now +- Stores data in a Sqlite database file ## Setup @@ -73,12 +74,6 @@ ## Build the image docker build -t 2fauth/2fauth https://github.com/Bubka/2FAuth.git#fba9e29bd4e3bb697296bb0bde60ae869537528b ``` -## Change database - -If you want to change database, for example switch from SQLite to MySQL, there is no migration yet. - -You might want to remove the `installed` file bind mounted in `/2fauth` so the database is re-created. - ## Implementation details - The container is based on `debian:buster-slim` diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 644bbf9c..299ac29e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -37,15 +37,8 @@ services: # If you set it to debug your logs will grow large, and fast. If you set it to emergency probably # nothing will get logged, ever. - APP_LOG_LEVEL=notice - # Database config & credentials - # DB_CONNECTION can be mysql - - DB_CONNECTION=sqlite + # Database config (can only be sqlite) - DB_DATABASE="/srv/database/database.sqlite" - # if you want to use MySQL: - - DB_HOST=mysql - - DB_PORT=3306 - - DB_USERNAME=homestead - - DB_PASSWORD=secret # If you're looking for performance improvements, you could install memcached. - CACHE_DRIVER=file - SESSION_DRIVER=file