forked from ctrlo/GADS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·104 lines (101 loc) · 2.56 KB
/
docker-compose.yml
File metadata and controls
executable file
·104 lines (101 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#
# Setup
#
# Copy config.yml-example to config.yml and configure:
# engines:
# session:
# YAML:
# is_secure: 0
# plugins:
# DBIC:
# default:
# dsn: dbi:Pg:database=postgres;host=db
# Auth::Extensible:
# realms:
# dbic:
# password_expiry_days: 9999
#
# Install npm modules
# $ docker run -v `pwd`:/home/node/app -it node:10-alpine sh
# $ cd /home/node/app
# $ yarn install
# $ exit
#
#
# Run: `docker-compose up`
#
# This will start the following services:
# - http://localhost:3000 (The app itself, login with user gads@ctrlo.local)
# - http://localhost:8080 (pgAdmin, login with gads@ctrlo.local / gads)
# - http://localhost:8025 (MailHog, all sent out mails will be captured over here)
#
# To login:
# - Request a password reset for gads@ctrlo.local
# - In the terminal, you should see an sql query similar to:
# UPDATE "user" SET "resetpw" = ? WHERE ( "id" = ? ): '[TOKEN]', '2'
# where TOKEN is a string made of numbers and lettres
# - visit: http://localhost:3000/resetpw/[TOKEN]
# - Follow explanation shown and you should be able to login
#
# Add additional npm packages
#
# $ docker run -u node -w /home/node/app -v `pwd`:/home/node/app -it node:10-alpine sh
# $ yarn install --add <package>
# $ exit
#
# Rebuild the app image (ie when an additional perl package is added)
# $ docker-compose build --no-cache app
#
# Debugging
#
# Enter a running container:
# $ docker-compose exec app bash
#
# If a container failed to start, run it manually:
# $ docker run -u 1000:1000 -v `pwd`:/gads -it gads_app /bin/bash
#
version: '3'
services:
app:
build: .
volumes:
- .:/gads
ports:
- 3000:3000
environment:
- DBIC_MIGRATION_USERNAME=postgres
- DBIC_MIGRATION_PASSWORD=postgres
user: 1000:1000
depends_on:
- db
db:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- db-data:/var/lib/postgresql/data
- ./share/seed/PostgreSQL:/docker-entrypoint-initdb.d
ports:
- 5432:5432
pgadmin:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=gads@ctrlo.local
- PGADMIN_DEFAULT_PASSWORD=gads
ports:
- 8080:80
mailhog:
image: mailhog/mailhog:v1.0.0
ports:
- 1025:1025
- 8025:8025
frontend:
image: node:10-alpine
volumes:
- .:/home/node/app
working_dir: /home/node/app
user: node
command: ["npm", "run", "start"]
volumes:
db-data: