Skip to content

Commit 438d0d2

Browse files
committed
Add startup script to run uwsgi in standalone mode without consul
1 parent dd51951 commit 438d0d2

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ COPY ./docker/uwsgi/uwsgi.ini /etc/uwsgi/uwsgi.ini
9494
COPY ./docker/uwsgi/consul-template-uwsgi.conf /etc/consul-template-uwsgi.conf
9595
RUN touch /etc/service/uwsgi/down
9696

97+
# Standalone version of uwsgi that doesn't require consul
98+
COPY ./docker/uwsgistandalone/uwsgi.service /etc/service/uwsgistandalone/run
99+
COPY ./docker/uwsgistandalone/uwsgi.ini /etc/uwsgi/uwsgi.ini
100+
RUN touch /etc/service/uwsgistandalone/down
101+
97102
# hl_extractor service files
98103
COPY ./docker/hl_extractor/hl_extractor.service /etc/service/hl_extractor/run
99104
COPY docker/hl_extractor/consul-template-hl-extractor.conf /etc/consul-template-hl-extractor.conf

docker/rc.local

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
# All services contain a name and an environment (e.g. acousticbrainz-web-prod).
88
# Set DEPLOY_ENV to 'prod' or 'beta' to indicate this
99

10+
if [ "${CONTAINER_ROLE}" = "acousticbrainz-standalone" ]
11+
then
12+
rm -f /etc/service/uwsgistandalone/down
13+
exit 0
14+
fi
15+
1016
if [ "${CONTAINER_ROLE}" = "acousticbrainz-web-${DEPLOY_ENV}" ]
1117
then
1218
rm -f /etc/service/uwsgi/down

docker/uwsgistandalone/uwsgi.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[uwsgi]
2+
master = true
3+
http = 0.0.0.0:3031
4+
module = server
5+
callable = application
6+
chdir = /code
7+
enable-threads = true
8+
processes = 100
9+
log-x-forwarded-for = true
10+
disable-logging = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec chpst -uacousticbrainz:acousticbrainz uwsgi --die-on-term /etc/uwsgi/uwsgi.ini

0 commit comments

Comments
 (0)