aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-05-13 12:11:06 +0100
committerLibravatar GitHub <noreply@github.com>2022-05-13 12:11:06 +0100
commit0cb24b3c34c02185b0799f8e9f3dbff48e8dede2 (patch)
tree85210af9dc566aec9fc93538a637e319ad2e3343
parentUpgrade 'node' (16.14 -> 16.15); Upgrade 'pnpm' (6 --> 7) (diff)
downloadferdium-server-0cb24b3c34c02185b0799f8e9f3dbff48e8dede2.tar.gz
ferdium-server-0cb24b3c34c02185b0799f8e9f3dbff48e8dede2.tar.zst
ferdium-server-0cb24b3c34c02185b0799f8e9f3dbff48e8dede2.zip
Add update recipes to ferdium server based on github repo (#33)
-rw-r--r--.dockerignore3
-rw-r--r--Dockerfile6
-rwxr-xr-xdocker/entrypoint.sh24
3 files changed, 31 insertions, 2 deletions
diff --git a/.dockerignore b/.dockerignore
index e97b248..84d3156 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -16,3 +16,6 @@ docker
16!docker/.env 16!docker/.env
17node_modules 17node_modules
18.husky 18.husky
19
20# Ignore recipes folder (it is pulled in the image by git)
21recipes
diff --git a/Dockerfile b/Dockerfile
index 36a1cc9..bc1e840 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,10 @@ LABEL maintainer="ferdium"
21ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data" 21ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data"
22 22
23RUN apk add --no-cache sqlite-libs curl su-exec 23RUN apk add --no-cache sqlite-libs curl su-exec
24RUN apk add --no-cache python3 make g++ py3-pip git py3-pip
25# The next command is needed for sqlite3 install command executed by node-gyp
26RUN ln -s /usr/bin/python3 /usr/bin/python
27
24 28
25COPY --from=build /server-build /app 29COPY --from=build /server-build /app
26RUN npm i -g @adonisjs/cli 30RUN npm i -g @adonisjs/cli
@@ -30,4 +34,4 @@ HEALTHCHECK --start-period=5s --interval=30s --retries=5 --timeout=3s CMD curl -
30COPY docker/entrypoint.sh /entrypoint.sh 34COPY docker/entrypoint.sh /entrypoint.sh
31COPY docker/.env /app/.env 35COPY docker/.env /app/.env
32 36
33CMD ["/entrypoint.sh"] 37ENTRYPOINT ["/entrypoint.sh"]
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 51df4e3..a928f7e 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -16,6 +16,28 @@ cat << "EOL"
16Brought to you by ferdium.org 16Brought to you by ferdium.org
17EOL 17EOL
18 18
19# Update recipes from official git repository
20npm i -gf pnpm@7.0.1
21
22if [ ! -d "/app/recipes/.git" ]; # When we mount an existing volume (ferdium-recipes-vol:/app/recipes) if this is only /app/recipes it is always true
23then
24 echo '**** Generating recipes for first run ****'
25 git clone --branch main https://github.com/ferdium/ferdium-recipes recipes
26else
27 echo '**** Updating recipes ****'
28 chown -R root /app/recipes # Fixes ownership problem when doing git pull -r
29 cd recipes
30 git stash -u
31 git pull -r
32 git stash pop
33 cd ..
34fi
35
36cd recipes
37pnpm i
38pnpm package
39cd ..
40
19key_file="${DATA_DIR}/FERDIUM_APP_KEY.txt" 41key_file="${DATA_DIR}/FERDIUM_APP_KEY.txt"
20 42
21print_app_key_message() { 43print_app_key_message() {
@@ -41,6 +63,6 @@ export APP_KEY
41 63
42node ace migration:run --force 64node ace migration:run --force
43 65
44chown -R "${PUID:-1000}":"${PGID:-1000}" "${DATA_DIR}" /app 66chown -R "${PUID:-1000}":"${PGID:-1000}" "${DATA_DIR}" /app # This is the cause of the problem on line 29/32
45 67
46su-exec "${PUID:-1000}":"${PGID:-1000}" node server.js 68su-exec "${PUID:-1000}":"${PGID:-1000}" node server.js