From edc8b54e8f381b9f91edbae75c783dfcde9897ec Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Dec 2018 14:39:28 +0100 Subject: [PATCH] Updates in install scripts --- docker/Dockerfile | 21 +++++++++++++++------ docker/docker-entrypoint.sh | 16 +--------------- setup/functions | 1 + 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e9d5cdfd..ad2ed9ba 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,13 +1,22 @@ -FROM node:8.6 +FROM node:10.14-jessie # First install dependencies -COPY ../server/package.json ./app/ +COPY ../server/package.json ./app/server +COPY ../client/package.json ./app/client +COPY ../shared/package.json ./app/shared +COPY ../zone-mta/package.json ./app/zone-mta + WORKDIR /app/ + ENV NODE_ENV production -RUN npm install --no-progress --production && npm install --no-progress passport-ldapjs passport-ldapauth -# Later, copy the app files. That improves development speed as buiding the Docker image will not have + +RUN for idx in client shared server zone-mta; do (cd $idx && npm install); done + +# Later, copy the app files. That improves development speed as buiding the Docker image will not have # to download and install all the NPM dependencies every time there's a change in the source code COPY .. /app + +RUN cd client && npm run build + EXPOSE 3000 -ENTRYPOINT ["bash", "/app/docker-entrypoint.sh"] -CMD ["node", "index.js"] +ENTRYPOINT ["bash", "/app/docker/docker-entrypoint.sh"] diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 00101596..bf9ae953 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,18 +1,4 @@ #!/bin/bash set -e -if [ ! -f "/app/config/production.toml" ] ; then - echo "No production.toml, copying from docker-production.toml.tmpl" - cp /app/config/docker-production.toml.tmpl /app/config/production.toml -fi -if [ ! -f "/app/workers/reports/config/production.toml" ] ; then - echo "No production.toml for reports" - if [ -f "/app/config/production.toml" ] ; then - echo "copying config/production.toml to reports config directory" - cp /app/config/production.toml /app/workers/reports/config/production.toml - else - echo "copying config/docker-production.toml.tmpl to reports config directory as production.toml" - cp /app/config/docker-production.toml.tmpl /app/workers/reports/config/production.toml - fi -fi -exec "$@" \ No newline at end of file +bash \ No newline at end of file diff --git a/setup/functions b/setup/functions index f8399dba..12c6586c 100644 --- a/setup/functions +++ b/setup/functions @@ -359,6 +359,7 @@ EOT ubuntu1804) a2enmod ssl + a2enmod rewrite a2enconf mailtrain systemctl restart apache2 ;;