This repository has been archived by the owner on Dec 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose-ci.yml
94 lines (93 loc) · 3.21 KB
/
docker-compose-ci.yml
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
# docker-compose-ci.yml
# Compose file to be used for CI deployments. ENV vars should be overwritten by
# using command line params or updated variables in this compose file.
# The compose comes with Letsencrypt SSL support and requires the host to be
# publicly accessible by port 80 and 443
# https://wiki.ssdt-ohio.org/display/rtd/Using+nginx-proxy
version: '3'
services:
db:
image: postgres:9.6.6-alpine
container_name: postgres
environment:
POSTGRES_USER: pharos
POSTGRES_DB: pharos
volumes:
- ./pharos-postgres:/var/lib/postgresql/data
ports:
- '5432:5432'
pharos:
build:
context: .
dockerfile: Dockerfile
image: aptrust/pharos
environment:
- DOCKERIZED='true'
- RAILS_ENV=${RAILS_ENV:-development}
- ENVIRONMENT=development
- PHAROS_DB_HOST=db
- PHAROS_DB_USER='pharos'
# PHAROS_DB_PASSWORD: 'password'
- SECRET_KEY_BASE= '74455f96b7e2ed8c5a798d9d302eded8f82327de69ee094e479b73318dce4dcc62f5cccd7ac285fe9a39fdd9e7658b54e35971eb630bf8695e6c3d47da265412'
- LETSENCRYPT_HOST=${PHAROS_DNS:-pharos.aptrust.local}
- VIRTUAL_HOST=pharos.docker.local
- VIRTUAL_PORT=9292
# TODO: -e demo needs fixing. doesn't read env vars in command line here. maybe dockfile cmd needs env var as entrypoint?
command: bundle exec puma -C config/puma -p9292
volumes:
- .:/pharos
links:
- db
depends_on:
- db
- migration
- nginx-proxy
labels:
- VIRTUAL_HOST=pharos.docker.local
- VIRTUAL_PORT=9292
ports:
- "9292:9292"
migration:
image: aptrust/pharos
# Note: Sleep 5 seconds before init db, so psql has time to start up.
command: /bin/bash -c "sleep 15 && rake db:exists && rake db:migrate || (echo 'Init DB setup' && rake db:setup && rake pharos:setup)"
environment:
DOCKERIZED: 'true'
RAILS_ENV: 'demo'
PHAROS_DB_HOST: 'db'
PHAROS_DB_USER: 'pharos'
# PHAROS_DB_PASSWORD: 'password'
SECRET_KEY_BASE: '74455f96b7e2ed8c5a798d9d302eded8f82327de69ee094e479b73318dce4dcc62f5cccd7ac285fe9a39fdd9e7658b54e35971eb630bf8695e6c3d47da265412'
volumes:
- .:/pharos
links:
- db
depends_on:
- db
nginx-proxy:
image: jwilder/nginx-proxy:alpine
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./docker/nginx-proxy/certs:/etc/nginx/certs:ro
- ./docker/nginx-proxy/vhost:/etc/nginx/vhost.d
- ./docker/nginx-proxy/public:/etc/share/nginx/html
- ./public:/etc/share/nginx/html/pharos
- ./docker/pharos.docker.localhost:/etc/nginx/vhost.d/pharos.docker.localhost
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
letsencrypt-nginx-proxy-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./docker/nginx-proxy/certs:/etc/nginx/certs:rw
- ./docker/nginx-proxy/vhost:/etc/nginx/vhost.d:rw
- ./docker/nginx-proxy/public:/usr/share/nginx/html:rw
environment:
- NGINX_PROXY_CONTAINER=nginx-proxy_nginx-proxy_1
depends_on:
- nginx-proxy