aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-05 20:43:13 +0100
committerLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-07 10:20:38 +0100
commit7e55e4bf83321c770645e9657589a620335fa029 (patch)
tree494f2b77a930fd68d61e5e536e469141562606f0 /docker
parentMoved getferdi/server-docker into getferdi/server repository. (diff)
downloadferdium-server-7e55e4bf83321c770645e9657589a620335fa029.tar.gz
ferdium-server-7e55e4bf83321c770645e9657589a620335fa029.tar.zst
ferdium-server-7e55e4bf83321c770645e9657589a620335fa029.zip
Modifying Dockerfile so that it can use the current application code to build the image. Update instructions for building image in README.md
Diffstat (limited to 'docker')
-rw-r--r--docker/.dockerignore13
-rw-r--r--docker/Dockerfile7
-rw-r--r--docker/README.md5
-rwxr-xr-xdocker/root/etc/cont-init.d/50-config10
4 files changed, 5 insertions, 30 deletions
diff --git a/docker/.dockerignore b/docker/.dockerignore
deleted file mode 100644
index 92207ac..0000000
--- a/docker/.dockerignore
+++ /dev/null
@@ -1,13 +0,0 @@
1.DS_Store
2
3# ignore .git and .cache folders
4.git
5.gitignore
6.github
7.gitattributes
8.cache
9
10# ignore all markdown files (md) beside all README*.md other than README-secret.md
11*.md
12!README*.md
13README-secret.md
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 2b165f5..a561509 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -59,6 +59,8 @@ RUN \
59 cd / && \ 59 cd / && \
60 rm -Rf "node-v$NODE_VERSION" && \ 60 rm -Rf "node-v$NODE_VERSION" && \
61 rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt 61 rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
62
63COPY . /app
62 64
63RUN \ 65RUN \
64 apk add --no-cache --virtual .build-deps-ferdi \ 66 apk add --no-cache --virtual .build-deps-ferdi \
@@ -69,9 +71,6 @@ RUN \
69 npm config set unsafe-perm true && \ 71 npm config set unsafe-perm true && \
70 npm install -g npm@latest && \ 72 npm install -g npm@latest && \
71 find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf && \ 73 find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf && \
72 echo "**** install ferdi server ****" && \
73 mkdir -p /ferdi && \
74 curl -o /ferdi/ferdi.tar.gz -L "https://github.com/getferdi/server/archive/master.tar.gz" && \
75 echo "**** cleanup ****" && \ 74 echo "**** cleanup ****" && \
76 apk del .build-deps-ferdi && \ 75 apk del .build-deps-ferdi && \
77 rm -rf \ 76 rm -rf \
@@ -88,7 +87,7 @@ RUN \
88 /usr/lib/node_modules/npm/html \ 87 /usr/lib/node_modules/npm/html \
89 /usr/lib/node_modules/npm/scripts 88 /usr/lib/node_modules/npm/scripts
90 89
91COPY root/ / 90COPY docker/root/ /
92 91
93USER root 92USER root
94 93
diff --git a/docker/README.md b/docker/README.md
index 8e0da08..5daa9fc 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -202,11 +202,10 @@ Below are the instructions for updating the container to get the most recent ver
202 202
203## Building locally 203## Building locally
204 204
205If you want to make local modifications to this image for development purposes or just to customize the logic: 205If you want to build this image locally, please run this command from root of [ferdi server repository](https://github.com/getferdi/server/tree/master/):
206``` 206```
207git clone https://github.com/getferdi/server-docker.git
208cd server-docker
209docker build \ 207docker build \
208 -f docker/Dockerfile \
210 --no-cache \ 209 --no-cache \
211 --pull \ 210 --pull \
212 -t getferdi/ferdi-server:latest . 211 -t getferdi/ferdi-server:latest .
diff --git a/docker/root/etc/cont-init.d/50-config b/docker/root/etc/cont-init.d/50-config
index 1c0caed..72b2d00 100755
--- a/docker/root/etc/cont-init.d/50-config
+++ b/docker/root/etc/cont-init.d/50-config
@@ -32,16 +32,6 @@ if [ -n "${TEST_RUN}" ]; then
32 echo '**** [services.d] done ****' 32 echo '**** [services.d] done ****'
33fi 33fi
34 34
35# install ferdi-server if necessary
36[[ -f /ferdi/ferdi.tar.gz ]] && \
37 echo "**** Installing Ferdi-server ****" && \
38 tar xf \
39 /ferdi/ferdi.tar.gz -C \
40 /app --strip-components=1 && \
41 rm -rf \
42 /ferdi && \
43 chown -R abc:abc /app
44
45# set ferdi-server status 35# set ferdi-server status
46echo " " 36echo " "
47echo "**** Checking Ferdi-server settings ****" 37echo "**** Checking Ferdi-server settings ****"