Skip to content

Commit 4301cef

Browse files
committed
update docs & tests
1 parent 3c29fd6 commit 4301cef

3 files changed

Lines changed: 20 additions & 22 deletions

File tree

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ RUN curl -L https://github.com/koel/koel/releases/download/${KOEL_VERSION_REF}/k
105105
&& rm -rf /tmp/*
106106

107107

108-
# Install x-sendfile for apache2
108+
# Install x-sendfile for apache2, fix home folder
109109
USER root
110-
RUN apk add --no-cache apache2-dev gcc musl-dev \
110+
RUN apk add --no-cache apache2-dev gcc musl-dev shadow \
111111
&& curl -o mod_xsendfile.c https://tn123.org/mod_xsendfile/mod_xsendfile.c \
112112
&& apxs -cia mod_xsendfile.c \
113113
&& rm mod_xsendfile.* \
114-
&& apk del --no-cache apache2-dev gcc musl-dev \
114+
&& usermod -d /var/www/
115+
&& apk del --no-cache apache2-dev gcc musl-dev shadow\
115116
&& mkdir /var/www/lib \
116117
&& ln -s /usr/lib/apache2 /var/www/lib/apache2
117118

@@ -181,7 +182,7 @@ CMD [""]
181182
EXPOSE 80
182183

183184
# Check that the homepage is displayed
184-
HEALTHCHECK --start-period=100m --interval=5m --timeout=5s \
185+
HEALTHCHECK --start-period=30s --interval=5m --timeout=5s \
185186
CMD curl -f http://localhost/sw.js || exit 1
186187

187188

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ docker-compose -f ./docker-compose.postgres.yml up -d
4141

4242
## The `koel:init` command
4343

44+
This command is automatically ran when the container starts, but can be disabled if you want to do some manual adjustments first. As such it is often sufficient to provide the needed env variables to the container to setup koel.
45+
4446
For the first installation and every subsequent upgrade, you will need to run the `koel:init` command, which handles migrations and other setup tasks.
4547
For instance, during the first run, this command will generate the `APP_KEY`, create the default admin user, and initialize the database. For subsequent runs, it will apply any new migrations and update the database schema as needed.
4648

4749
In order to run this command, you first need to `exec` into the container (replace `<container_name_for_koel>` with the name of your running Koel container):
4850

4951
```bash
50-
docker exec --user www-data -it <container_name_for_koel> bash
52+
docker exec --user www-data -it <container_name_for_koel> sh
5153
```
5254

5355
Once inside the container, run the `koel:init` command:
@@ -142,7 +144,7 @@ Once you have generated an `APP_KEY` you can provide it as environment variables
142144

143145
```bash
144146
# Run a container just to generate the key
145-
docker run -it --rm phanan/koel bash
147+
docker run -it --rm phanan/koel sh
146148
# In the container, generate APP_KEY
147149
$ php artisan key:generate --force
148150
# Show the modified .env file
@@ -188,7 +190,7 @@ For all new songs, the search index will be automatically populated by `php arti
188190

189191
> [!IMPORTANT]
190192
> This list is not exhaustive and may not be up-to-date. See [`.env.example`][koel-env-example] for a complete reference.
191-
193+
- `SKIP_INIT` : set a value to prevent the container from automatically running the init script on startup
192194
- `DB_CONNECTION`: `mysql` OR `pgsql` OR `sqlsrv` OR `sqlite-persistent`. Corresponds to the type of database being used with Koel.
193195
- `DB_HOST`: `database`. The name of the Docker container hosting the database. Koel needs to be on the same Docker network to find the database by its name.
194196
- `DB_USERNAME`: `koel`. If you change it, also change it in the database container.
@@ -199,6 +201,7 @@ For all new songs, the search index will be automatically populated by `php arti
199201
- `MEMORY_LIMIT`: The amount of memory in MB for the scanning process. Increase this value if `php artisan koel:scan` runs out of memory.
200202
- `LASTFM_API_KEY` and `LASTFM_API_SECRET`: Enables Last.fm integration. See https://docs.koel.dev/3rd-party.html#last-fm
201203
- `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET`: Enables Spotify integration. See https://docs.koel.dev/3rd-party.html#spotify
204+
- `OPTIMIZE_CONFIG` Preload and optimize the config. This disables your ability to do config edits while the container is running. If you enable this every config change will require a container restart to apply.
202205

203206
## Volumes
204207

goss.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,41 +87,35 @@ file:
8787
package:
8888
ffmpeg:
8989
installed: true
90-
libapache2-mod-xsendfile:
91-
installed: true
9290
port:
9391
tcp:80:
9492
listening: true
9593
ip:
9694
- 0.0.0.0
97-
service:
98-
apache2:
99-
enabled: true
100-
skip: false
101-
running: true
95+
tcp:9000:
96+
listening: true
97+
ip:
98+
- 127.0.0.1
10299
user:
103100
www-data:
104101
exists: true
105-
uid: 33
106-
gid: 33
102+
uid: 102
103+
gid: 82
107104
groups:
108105
- www-data
109106
home: /var/www
110-
shell: /usr/sbin/nologin
107+
shell: /sbin/nologin
111108
group:
112109
www-data:
113110
exists: true
114-
gid: 33
111+
gid: 82
115112
command:
116113
artisan_env:
117-
exec: php artisan env
114+
exec: php /var/www/html/artisan env
118115
exit-status: 0
119116
stdout: ['/production/']
120117
stderr: []
121118
timeout: 0
122-
process:
123-
apache2:
124-
running: true
125119
http:
126120
http://localhost/sw.js:
127121
status: 200

0 commit comments

Comments
 (0)