Skip to content

Commit f1c5d83

Browse files
committed
new docker files and readme entry for docker development server
1 parent 82251d1 commit f1c5d83

File tree

5 files changed

+519
-344
lines changed

5 files changed

+519
-344
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ npm-debug.log
77
.DS_Store
88
dump.rdb
99

10+
mvis/client/package-lock.json
11+
mvis/server/package-lock.json
12+
mvis/test-embed/package-lock.json

Dockerfile-Develop

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Final Develop Image
2+
FROM node:10-alpine
3+
4+
WORKDIR /app/
5+
6+
# Install system dependencies
7+
RUN set -ex; \
8+
apk add --update --no-cache \
9+
make gcc g++ git python pwgen netcat-openbsd bash imagemagick
10+
11+
EXPOSE 3000 3003 3004
12+
13+
# Keep container running, so you can access it
14+
CMD tail -f /dev/null

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,32 @@ These are the steps to start Mailtrain via docker-compose:
199199
200200
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.
201201
202+
203+
### Deployment with Docker and Docker compose (for development)
204+
This setup starts a stack like above, but is tweaked to be used for local development using docker containers.
205+
206+
1. Clone this repository
207+
208+
2. Bring up the development stack
209+
```
210+
docker-compose -f docker-compose-develop.yml up -d
211+
```
212+
3. Connect to a shell inside the container
213+
```
214+
docker-compose exec mailtrain bash
215+
```
216+
4. Run these commands once to install all the node modules and build the client webapp
217+
```
218+
cd /app
219+
bash setup/reinstall-modules.sh
220+
cd /app/client && npm run build && cd /app
221+
222+
5. Start the server for the first time with this command, to generate the `server/config/production.yaml`
223+
```
224+
bash docker-entrypoint.sh
225+
```
226+
227+
202228
### Docker Environment Variables
203229
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
204230
file. You can give them a value directly in the `docker-compose.yml` config file.

docker-compose-develop.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: '3'
2+
3+
services:
4+
mysql:
5+
image: mariadb:10.4
6+
environment:
7+
- MYSQL_ROOT_PASSWORD=mailtrain
8+
- MYSQL_DATABASE=mailtrain
9+
- MYSQL_USER=mailtrain
10+
- MYSQL_PASSWORD=mailtrain
11+
volumes:
12+
- mysql-data:/var/lib/mysql
13+
14+
redis:
15+
image: redis:5
16+
volumes:
17+
- redis-data:/data
18+
19+
mongo:
20+
image: mongo:4-xenial
21+
volumes:
22+
- mongo-data:/data/db
23+
24+
mailtrain:
25+
build:
26+
context: .
27+
dockerfile: Dockerfile-Develop
28+
ports:
29+
- "3000:3000"
30+
- "3003:3003"
31+
- "3004:3004"
32+
volumes:
33+
- ./:/app
34+
35+
volumes:
36+
mysql-data:
37+
redis-data:
38+
mongo-data:

0 commit comments

Comments
 (0)