-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YDA-6001: run MSL-API worker / web in 1 container
Run the MSL-API queue worker and web server in a single container by default, for ease of development. Retain an alternative setup with separate containers.
- Loading branch information
Showing
5 changed files
with
143 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# This is a locally modified version of the upstream CKAN docker compose file. | ||
# | ||
# This version runs two separate containers for MSL-API (one for the web server and | ||
# one for the queue worker) | ||
|
||
version: "3" | ||
|
||
volumes: | ||
ckan_config: | ||
ckan_home: | ||
ckan_storage: | ||
ckan_coveragedata: | ||
pg_data: | ||
solr_data: | ||
nginx_config: | ||
nginx_certificates: | ||
mslapi_signal: | ||
mslapi_storage: | ||
|
||
services: | ||
ckan: | ||
container_name: ckan | ||
image: epos-msl-ckan:latest | ||
links: | ||
- db | ||
- solr | ||
- redis | ||
depends_on: | ||
- db | ||
- solr | ||
- redis | ||
ports: | ||
- "0.0.0.0:${CKAN_PORT}:5000" | ||
environment: | ||
- CKAN_SQLALCHEMY_URL=postgresql://ckan:${POSTGRES_PASSWORD}@db/ckan_default | ||
- CKAN_SOLR_URL=http://solr:8983/solr/ckan | ||
- CKAN_REDIS_URL=redis://redis:6379/1 | ||
- CKAN_SITE_URL=${CKAN_SITE_URL} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
volumes: | ||
- ckan_config:/etc/ckan | ||
- ckan_home:/usr/lib/ckan | ||
- ckan_storage:/var/lib/ckan | ||
- ckan_coveragedata:/coverage | ||
|
||
nginx: | ||
container_name: nginx | ||
image: epos-msl-nginx:latest | ||
environment: | ||
- EPOS_MSL_HOST=${EPOS_MSL_HOST} | ||
ports: | ||
- "18443:443" | ||
volumes: | ||
- nginx_config:/etc/nginx/conf.d | ||
- nginx_certificates:/etc/certificates | ||
|
||
db: | ||
container_name: db | ||
image: postgres:12.20 | ||
environment: | ||
- POSTGRES_DB=ckan_default | ||
- POSTGRES_USER=ckan | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- PGDATA=/var/lib/postgresql/data/db | ||
volumes: | ||
- pg_data:/var/lib/postgresql/data | ||
|
||
mslapi_db: | ||
container_name: mslapi_db | ||
image: mysql:8.0.39-debian | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} | ||
|
||
mslapi_webserver: | ||
container_name: mslapi_web | ||
image: epos-msl-api:latest | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} | ||
- MSLAPI_ROLE=WEBSERVER | ||
volumes: | ||
- mslapi_signal:/signal | ||
- mslapi_storage:/storage | ||
|
||
mslapi_worker: | ||
container_name: mslapi_worker | ||
image: epos-msl-api:latest | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} | ||
- MSLAPI_ROLE=QUEUE_WORKER | ||
volumes: | ||
- mslapi_signal:/signal | ||
- mslapi_storage:/storage | ||
|
||
solr: | ||
container_name: solr | ||
image: epos-msl-solr:latest | ||
volumes: | ||
- solr_data:/opt/solr/server/solr/ckan/data | ||
|
||
redis: | ||
container_name: redis | ||
image: redis:6.2 |
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,24 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile=/var/log/supervisord.log | ||
pidfile=/var/run/supervisord.pid | ||
|
||
[program:nginx] | ||
command=/usr/sbin/nginx -g 'daemon off;' | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/nginx-supervisord.log | ||
stderr_logfile=/var/log/nginx-supervisord-error.log | ||
user=root | ||
|
||
[program:laravel-queue] | ||
command=/usr/bin/php8.0 /var/www/msl_api/artisan queue:work --rest=1 --tries=3 --timeout=300 | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/var/log/laravel-queue-supervisord.log | ||
stderr_logfile=/var/log/laravel-queue-supervisord-error.log | ||
directory=/var/www/msl_api | ||
user=www-data | ||
|
||
[group:laravel] | ||
programs=nginx,laravel-queue |