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 | |
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
-rw-r--r-- | Dockerfile (renamed from docker/Dockerfile) | 1 | ||||
-rw-r--r-- | README.md | 40 | ||||
-rw-r--r-- | config/database.js | 2 | ||||
-rw-r--r-- | docker/README.md | 1 | ||||
-rw-r--r-- | docker/docker-compose.yml | 6 | ||||
-rwxr-xr-x | docker/entrypoint.sh | 2 |
6 files changed, 7 insertions, 45 deletions
diff --git a/docker/Dockerfile b/Dockerfile index 799bb0b..416c503 100644 --- a/docker/Dockerfile +++ b/Dockerfile | |||
@@ -18,7 +18,6 @@ ENV HOST=0.0.0.0 PORT=3333 | |||
18 | RUN ["apk", "add", "--no-cache", "sqlite-libs", "curl"] | 18 | RUN ["apk", "add", "--no-cache", "sqlite-libs", "curl"] |
19 | 19 | ||
20 | COPY --from=build /server-build /app | 20 | COPY --from=build /server-build /app |
21 | RUN ["touch", ".env"] | ||
22 | RUN ["npm", "i", "-g", "@adonisjs/cli"] | 21 | RUN ["npm", "i", "-g", "@adonisjs/cli"] |
23 | 22 | ||
24 | HEALTHCHECK --interval=5m --timeout=3s CMD curl -sSf http://localhost:${PORT}/health | 23 | HEALTHCHECK --interval=5m --timeout=3s CMD curl -sSf http://localhost:${PORT}/health |
@@ -78,45 +78,7 @@ After setting up the docker container we recommend you to set up an NGINX revers | |||
78 | getferdi/ferdi-server | 78 | getferdi/ferdi-server |
79 | ``` | 79 | ``` |
80 | 80 | ||
81 | Alternatively, you can also use docker-compose v2 schemas | 81 | Alternatively, you can also use docker-compose v2 schemas. An example can be found in [./docker/docker-compose.yml](https://github.com/getferdi/server/tree/master/docker/docker-compose.yml) file. |
82 | |||
83 | ```sh | ||
84 | --- | ||
85 | version: "2" | ||
86 | services: | ||
87 | ferdi-server: | ||
88 | image: getferdi/ferdi-server | ||
89 | container_name: ferdi-server | ||
90 | environment: | ||
91 | - NODE_ENV=development | ||
92 | - EXTERNAL_DOMAIN=<ferdi-serverdomain> | ||
93 | - DB_CONNECTION=<database> | ||
94 | - DB_HOST=<yourdbhost> | ||
95 | - DB_PORT=<yourdbPORT> | ||
96 | - DB_USER=<yourdbuser> | ||
97 | - DB_PASSWORD=<yourdbpass> | ||
98 | - DB_DATABASE=<yourdbdatabase> | ||
99 | - DB_SSL=true/false | ||
100 | - MAIL_CONNECTION=<mailsender> | ||
101 | - SMPT_HOST=<smtpmailserver> | ||
102 | - SMTP_PORT=<smtpport> | ||
103 | - MAIL_SSL=true/false | ||
104 | - MAIL_USERNAME=<yourmailusername> | ||
105 | - MAIL_PASSWORD=<yourmailpassword> | ||
106 | - MAIL_SENDER=<sendemailaddress> | ||
107 | - IS_CREATION_ENABLED=true/false | ||
108 | - IS_DASHBOARD_ENABLED=true/false | ||
109 | - IS_REGISTRATION_ENABLED=true/false | ||
110 | - CONNECT_WITH_FRANZ=true/false | ||
111 | volumes: | ||
112 | - <path to data>:/config | ||
113 | - <path to database>:/app/database | ||
114 | - <path to recipes>:/app/recipes | ||
115 | ports: | ||
116 | - <port>:80 | ||
117 | restart: unless-stopped | ||
118 | ``` | ||
119 | You can also use sample [./docker/docker-compose.yml](https://github.com/getferdi/server/tree/master/docker/docker-compose.yml) file. | ||
120 | 82 | ||
121 | 3. Optionally, you can now [set up Nginx as a reverse proxy](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#set-up-nginx-as-a-reverse-proxy-server). | 83 | 3. Optionally, you can now [set up Nginx as a reverse proxy](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#set-up-nginx-as-a-reverse-proxy-server). |
122 | 84 | ||
diff --git a/config/database.js b/config/database.js index 6e08035..b7f57ad 100644 --- a/config/database.js +++ b/config/database.js | |||
@@ -31,7 +31,7 @@ module.exports = { | |||
31 | sqlite: { | 31 | sqlite: { |
32 | client: 'sqlite3', | 32 | client: 'sqlite3', |
33 | connection: { | 33 | connection: { |
34 | filename: `${Env.get('DATA_DIR', 'database')}/${Env.get('DB_DATABASE', 'development')}.sqlite`, | 34 | filename: Helpers.appRoot(`${Env.get('DATA_DIR', 'database')}/${Env.get('DB_DATABASE', 'development')}.sqlite`), |
35 | }, | 35 | }, |
36 | useNullAsDefault: true, | 36 | useNullAsDefault: true, |
37 | debug: Env.get('DB_DEBUG', false), | 37 | debug: Env.get('DB_DEBUG', false), |
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 | ||