New project structure

Beta of extract.js for extracting english locale
This commit is contained in:
Tomas Bures 2018-11-18 15:38:52 +01:00
parent e18d2b2f84
commit 2edbd67205
247 changed files with 6405 additions and 4237 deletions

13
docker/Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM node:8.6
# First install dependencies
COPY ../server/package.json ./app/
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
# to download and install all the NPM dependencies every time there's a change in the source code
COPY .. /app
EXPOSE 3000
ENTRYPOINT ["bash", "/app/docker-entrypoint.sh"]
CMD ["node", "index.js"]

View file

@ -0,0 +1,14 @@
version: '2'
services:
mysql:
restart: always
redis:
restart: always
mailtrain:
build: ./
# volumes:
# - ./:/app
ports:
- "3000:3000"
restart: always

33
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,33 @@
# FIXME - this is not yet upgraded to Mailtrain 2
version: '2'
services:
mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=mailtrain
- MYSQL_DATABASE=mailtrain
- MYSQL_USER=mailtrain
- MYSQL_PASSWORD=mailtrain
volumes:
- mailtrain-mysq-data:/var/lib/mysql
redis:
image: redis:3.0
volumes:
- mailtrain-redis-data:/data
mailtrain:
image: mailtrain:latest
depends_on:
- mysql
- redis
volumes:
- mailtrain-node-config:/app/config
- mailtrain-node-data:/app/public/grapejs/uploads
- mailtrain-node-data:/app/public/mosaico/uploads
- mailtrain-node-reports:/app/protected/reports
volumes:
mailtrain-mysq-data: {}
mailtrain-redis-data: {}
mailtrain-node-data: {}
mailtrain-node-config: {}
mailtrain-node-reports: {}

View file

@ -0,0 +1,18 @@
#!/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 "$@"