-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating an example docker compose file for production.
- Loading branch information
Showing
5 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Use this file to easily define all of your cron jobs. | ||
# | ||
# It's helpful, but not entirely necessary to understand cron before proceeding. | ||
# http://en.wikipedia.org/wiki/Cron | ||
|
||
# Example: | ||
# | ||
# set :output, "/path/to/my/cron_log.log" | ||
# | ||
# every 2.hours do | ||
# command "/usr/bin/some_great_command" | ||
# runner "MyModel.some_method" | ||
# rake "some:great:rake:task" | ||
# end | ||
# | ||
# every 4.days do | ||
# runner "AnotherModel.prune_old_records" | ||
# end | ||
|
||
# Learn more: http://github.com/javan/whenever | ||
|
||
# To execute: bundle exec whenever | ||
|
||
# Email job output by setting the mailto: option | ||
# See https://github.com/javan/whenever#customize-email-recipient-with-the-mailto-environment-variable | ||
every '0 0 * * *', mailto: '[email protected]' do | ||
rake "data:migrate" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
version: '3.7' | ||
|
||
volumes: | ||
postgres: | ||
solr_data: | ||
solr_backups: | ||
|
||
networks: | ||
solr: | ||
db: | ||
|
||
secrets: | ||
master_key: | ||
file: ./config/master.key | ||
|
||
services: | ||
solr1: | ||
image: solr:9.0.0 | ||
container_name: solr1 | ||
ports: | ||
- "8981:8983" | ||
environment: | ||
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181 | ||
volumes: | ||
- solr_data:/var/solr | ||
- solr_backups:/var/backups | ||
networks: | ||
- solr | ||
depends_on: | ||
- zoo1 | ||
- zoo2 | ||
- zoo3 | ||
|
||
solr2: | ||
image: solr:9.0.0 | ||
container_name: solr2 | ||
ports: | ||
- "8982:8983" | ||
environment: | ||
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181 | ||
volumes: | ||
- solr_data:/var/solr | ||
- solr_backups:/var/backups | ||
networks: | ||
- solr | ||
depends_on: | ||
- zoo1 | ||
- zoo2 | ||
- zoo3 | ||
|
||
solr3: | ||
image: solr:9.0.0 | ||
container_name: solr3 | ||
ports: | ||
- "8983:8983" | ||
environment: | ||
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181 | ||
volumes: | ||
- solr_data:/var/solr | ||
- solr_backups:/var/backups | ||
networks: | ||
- solr | ||
depends_on: | ||
- zoo1 | ||
- zoo2 | ||
- zoo3 | ||
|
||
zoo1: | ||
image: zookeeper:3.6.2 | ||
container_name: zoo1 | ||
restart: always | ||
hostname: zoo1 | ||
ports: | ||
- 2181:2181 | ||
- 7001:7000 | ||
environment: | ||
ZOO_MY_ID: 1 | ||
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181 | ||
ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok | ||
ZOO_CFG_EXTRA: "metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider metricsProvider.httpPort=7000 metricsProvider.exportJvmInfo=true" | ||
volumes: | ||
- solr_backups:/var/backups | ||
networks: | ||
- solr | ||
|
||
zoo2: | ||
image: zookeeper:3.6.2 | ||
container_name: zoo2 | ||
restart: always | ||
hostname: zoo2 | ||
ports: | ||
- 2182:2181 | ||
- 7002:7000 | ||
environment: | ||
ZOO_MY_ID: 2 | ||
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181 | ||
ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok | ||
ZOO_CFG_EXTRA: "metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider metricsProvider.httpPort=7000 metricsProvider.exportJvmInfo=true" | ||
volumes: | ||
- solr_backups:/var/backups | ||
networks: | ||
- solr | ||
|
||
zoo3: | ||
image: zookeeper:3.6.2 | ||
container_name: zoo3 | ||
restart: always | ||
hostname: zoo3 | ||
ports: | ||
- 2183:2181 | ||
- 7003:7000 | ||
environment: | ||
ZOO_MY_ID: 3 | ||
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181 | ||
ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok | ||
ZOO_CFG_EXTRA: "metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider metricsProvider.httpPort=7000 metricsProvider.exportJvmInfo=true" | ||
volumes: | ||
- solr_backups:/var/backups | ||
networks: | ||
- solr | ||
|
||
postgres: | ||
image: "postgres:15.0-alpine" | ||
restart: always | ||
environment: | ||
- POSTGRES_USER=rails | ||
- POSTGRES_PASSWORD=400zzAFOQ2t2llyAJBt | ||
- POSTGRES_DB=hxs_blacklight | ||
ports: | ||
- '5438:5432' | ||
volumes: | ||
- postgres:/var/lib/postgresql/data | ||
networks: | ||
- db | ||
|
||
app: | ||
build: | ||
context: . | ||
dockerfile: .docker/rails.prod.Dockerfile | ||
args: | ||
- RAILS_PORT=3000 | ||
secrets: | ||
- master_key | ||
environment: | ||
- SOLR_URL=http://solr1:8983/solr/blacklight-core | ||
- DATABASE_URL=postgres://rails:400zzAFOQ2t2llyAJBt@postgres:5432/hxs_blacklight | ||
ports: | ||
- "3000:3000" | ||
command: | ||
- "bundle exec rails server -p 3000 -b 0.0.0.0" | ||
networks: | ||
- solr | ||
- db | ||
depends_on: | ||
- postgres | ||
- solr1 | ||
- solr2 | ||
- solr3 | ||
|
||
worker: | ||
build: | ||
context: . | ||
dockerfile: .docker/rails.prod.Dockerfile | ||
args: | ||
- RAILS_PORT=3000 | ||
secrets: | ||
- master_key | ||
environment: | ||
- SOLR_URL=http://solr1:8983/solr/blacklight-core | ||
- DATABASE_URL=postgres://rails:400zzAFOQ2t2llyAJBt@postgres:5432/hxs_blacklight | ||
command: | ||
- "cron -f" | ||
networks: | ||
- solr | ||
- db |