diff options
author | Michal Kostewicz <m.kostewicz84@gmail.com> | 2021-02-07 14:23:57 +0100 |
---|---|---|
committer | Michal Kostewicz <m.kostewicz84@gmail.com> | 2021-02-07 14:23:57 +0100 |
commit | 02000d89159ba171cabbd341139871236f3df386 (patch) | |
tree | c1b4806a347fa6e6b224f42eae36011a71e24309 /docker | |
parent | Change database.js so any system folder can be used to keep database files (diff) | |
download | ferdium-server-02000d89159ba171cabbd341139871236f3df386.tar.gz ferdium-server-02000d89159ba171cabbd341139871236f3df386.tar.zst ferdium-server-02000d89159ba171cabbd341139871236f3df386.zip |
Revert line which choose DB folder using env. Move Dockerfile to root. Simplify export in entrypoint. Update README
Diffstat (limited to 'docker')
-rw-r--r-- | docker/Dockerfile | 27 | ||||
-rw-r--r-- | docker/README.md | 1 | ||||
-rw-r--r-- | docker/docker-compose.yml | 6 | ||||
-rwxr-xr-x | docker/entrypoint.sh | 2 |
4 files changed, 5 insertions, 31 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 799bb0b..0000000 --- a/docker/Dockerfile +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | FROM node:lts-alpine as build | ||
2 | |||
3 | WORKDIR /server-build | ||
4 | |||
5 | RUN ["apk", "add", "--no-cache", "python", "make", "gcc", "g++", "libc-dev", "sqlite-dev"] | ||
6 | |||
7 | COPY . /server-build | ||
8 | |||
9 | RUN ["npm", "ci", "--production", "--build-from-source", "--sqlite=/usr/local"] | ||
10 | |||
11 | FROM node:lts-alpine | ||
12 | |||
13 | WORKDIR /app | ||
14 | LABEL maintainer="xthursdayx" | ||
15 | |||
16 | ENV HOST=0.0.0.0 PORT=3333 | ||
17 | |||
18 | RUN ["apk", "add", "--no-cache", "sqlite-libs", "curl"] | ||
19 | |||
20 | COPY --from=build /server-build /app | ||
21 | RUN ["touch", ".env"] | ||
22 | RUN ["npm", "i", "-g", "@adonisjs/cli"] | ||
23 | |||
24 | HEALTHCHECK --interval=5m --timeout=3s CMD curl -sSf http://localhost:${PORT}/health | ||
25 | |||
26 | COPY docker/entrypoint.sh /entrypoint.sh | ||
27 | CMD ["/entrypoint.sh"] \ No newline at end of file | ||
diff --git a/docker/README.md b/docker/README.md index 5daa9fc..995ca8a 100644 --- a/docker/README.md +++ b/docker/README.md | |||
@@ -101,6 +101,7 @@ After the first run, Ferdi-server's configuration is saved inside the `config.tx | |||
101 | | `-e IS_DASHBOARD_ENABLED=true` | for specifying whether to enable the Ferdi-server dashboard, default is true | | 101 | | `-e IS_DASHBOARD_ENABLED=true` | for specifying whether to enable the Ferdi-server dashboard, default is true | |
102 | | `-e IS_REGISTRATION_ENABLED=true` | for specifying whether to allow user registration, default is true | | 102 | | `-e IS_REGISTRATION_ENABLED=true` | for specifying whether to allow user registration, default is true | |
103 | | `-e CONNECT_WITH_FRANZ=true` | for specifying whether to enable connections to the Franz server, default is true | | 103 | | `-e CONNECT_WITH_FRANZ=true` | for specifying whether to enable connections to the Franz server, default is true | |
104 | | `-e DATA_DIR=database` | for specifying sql-lite database folder, default is database | | ||
104 | | `-v <path to data>:/config` | this will store persistent ENV data on the docker host | | 105 | | `-v <path to data>:/config` | this will store persistent ENV data on the docker host | |
105 | | `-v <path to database>:/app/database` | this will strore Ferdi-server's database on the docker host for persistence | | 106 | | `-v <path to database>:/app/database` | this will strore Ferdi-server's database on the docker host for persistence | |
106 | | `-v <path to recipes>:/app/recipes` | this will strore Ferdi-server's recipes on the docker host for persistence | | 107 | | `-v <path to recipes>:/app/recipes` | this will strore Ferdi-server's recipes on the docker host for persistence | |
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 364f9c3..8a8c795 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml | |||
@@ -24,10 +24,10 @@ services: | |||
24 | - IS_DASHBOARD_ENABLED=true | 24 | - IS_DASHBOARD_ENABLED=true |
25 | - IS_REGISTRATION_ENABLED=true | 25 | - IS_REGISTRATION_ENABLED=true |
26 | - CONNECT_WITH_FRANZ=false | 26 | - CONNECT_WITH_FRANZ=false |
27 | - DATA_DIR=/database | 27 | - DATA_DIR=my-database |
28 | volumes: | 28 | volumes: |
29 | - ferdi-config-vol:/config | 29 | - ferdi-config-vol:/config |
30 | - ferdi-database-vol:/database | 30 | - ferdi-database-vol:/app/my-database |
31 | - ferdi-recipes-vol:/app/recipes | 31 | - ferdi-recipes-vol:/app/recipes |
32 | ports: | 32 | ports: |
33 | - 3333:3333 | 33 | - 3333:3333 |
@@ -35,4 +35,4 @@ services: | |||
35 | volumes: | 35 | volumes: |
36 | ferdi-config-vol: | 36 | ferdi-config-vol: |
37 | ferdi-database-vol: | 37 | ferdi-database-vol: |
38 | ferdi-recipes-vol: \ No newline at end of file | 38 | ferdi-recipes-vol: |
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index cb0dd0f..667196e 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh | |||
@@ -33,7 +33,7 @@ elif [ -f "/config/FERDI_APP_KEY.txt" ]; | |||
33 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" | 33 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" |
34 | fi | 34 | fi |
35 | 35 | ||
36 | export APP_KEY=$APP_KEY | 36 | export APP_KEY |
37 | 37 | ||
38 | node ace migration:run --force | 38 | node ace migration:run --force |
39 | 39 | ||