Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
8eac78aa3a
3 changed files with 78 additions and 0 deletions
14
Dockerfile-Develop
Normal file
14
Dockerfile-Develop
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Final Develop Image
|
||||||
|
FROM node:10-alpine
|
||||||
|
|
||||||
|
WORKDIR /app/
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN set -ex; \
|
||||||
|
apk add --update --no-cache \
|
||||||
|
make gcc g++ git python pwgen netcat-openbsd bash imagemagick
|
||||||
|
|
||||||
|
EXPOSE 3000 3003 3004
|
||||||
|
|
||||||
|
# Keep container running, so you can access it
|
||||||
|
CMD tail -f /dev/null
|
26
README.md
26
README.md
|
@ -199,6 +199,32 @@ These are the steps to start Mailtrain via docker-compose:
|
||||||
|
|
||||||
The instructions above use an automatically built Docker image on DockerHub (https://hub.docker.com/r/mailtrain/mailtrain). If you want to build the Docker image yourself (e.g. when doing development), use the `docker-compose-local.yml` located in the project's root directory.
|
The instructions above use an automatically built Docker image on DockerHub (https://hub.docker.com/r/mailtrain/mailtrain). If you want to build the Docker image yourself (e.g. when doing development), use the `docker-compose-local.yml` located in the project's root directory.
|
||||||
|
|
||||||
|
|
||||||
|
### Deployment with Docker and Docker compose (for development)
|
||||||
|
This setup starts a stack like above, but is tweaked to be used for local development using docker containers.
|
||||||
|
|
||||||
|
1. Clone this repository
|
||||||
|
|
||||||
|
2. Bring up the development stack
|
||||||
|
```
|
||||||
|
docker-compose -f docker-compose-develop.yml up -d
|
||||||
|
```
|
||||||
|
3. Connect to a shell inside the container
|
||||||
|
```
|
||||||
|
docker-compose exec mailtrain bash
|
||||||
|
```
|
||||||
|
4. Run these commands once to install all the node modules and build the client webapp
|
||||||
|
```
|
||||||
|
cd /app
|
||||||
|
bash setup/reinstall-modules.sh
|
||||||
|
cd /app/client && npm run build && cd /app
|
||||||
|
|
||||||
|
5. Start the server for the first time with this command, to generate the `server/config/production.yaml`
|
||||||
|
```
|
||||||
|
bash docker-entrypoint.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Docker Environment Variables
|
### Docker Environment Variables
|
||||||
When using Docker, you can override the default Mailtrain settings via the following environment variables. These variables have to be defined in the docker-compose config
|
When using Docker, you can override the default Mailtrain settings via the following environment variables. These variables have to be defined in the docker-compose config
|
||||||
file. You can give them a value directly in the `docker-compose.yml` config file.
|
file. You can give them a value directly in the `docker-compose.yml` config file.
|
||||||
|
|
38
docker-compose-develop.yml
Normal file
38
docker-compose-develop.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mariadb:10.4
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=mailtrain
|
||||||
|
- MYSQL_DATABASE=mailtrain
|
||||||
|
- MYSQL_USER=mailtrain
|
||||||
|
- MYSQL_PASSWORD=mailtrain
|
||||||
|
volumes:
|
||||||
|
- mysql-data:/var/lib/mysql
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:5
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: mongo:4-xenial
|
||||||
|
volumes:
|
||||||
|
- mongo-data:/data/db
|
||||||
|
|
||||||
|
mailtrain:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-Develop
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
- "3003:3003"
|
||||||
|
- "3004:3004"
|
||||||
|
volumes:
|
||||||
|
- ./:/app
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mysql-data:
|
||||||
|
redis-data:
|
||||||
|
mongo-data:
|
Loading…
Reference in a new issue