Skip to content

Commit

Permalink
Openresty container (#7214)
Browse files Browse the repository at this point in the history
  • Loading branch information
stereosteve authored Jan 17, 2024
1 parent 33f7597 commit f5cee04
Show file tree
Hide file tree
Showing 7 changed files with 469 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .circleci/src/workflows/discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ jobs:
filters:
branches:
only: main
- push-docker-image:
name: push-discovery-provider-openresty
context: [Vercel, dockerhub]
service: discovery-provider-openresty
filters:
branches:
only: main
- push-docker-image:
name: push-discovery-provider-notifications
context: [Vercel, dockerhub]
Expand Down Expand Up @@ -130,7 +137,7 @@ jobs:
only: main
requires:
- push-pedalboard-trending-challenge-rewards

- push-arm-image:
name: push-pedalboard-relay-arm
context: [Vercel, dockerhub]
Expand Down Expand Up @@ -211,7 +218,6 @@ jobs:
requires:
- push-ddex


# Deploy audius-protocol `main` branch (stage)
- deploy-stage-nodes:
name: deploy-stage-discovery-provider
Expand All @@ -220,6 +226,7 @@ jobs:
- test-discovery-provider
- test-discovery-provider-notifications
- push-discovery-provider
- push-discovery-provider-openresty
- push-discovery-provider-notifications
- push-pedalboard-trending-challenge-rewards
- push-pedalboard-relay
Expand Down
6 changes: 6 additions & 0 deletions dev-tools/compose/docker-compose.discovery.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
extends:
file: docker-compose.discovery.prod.yml
service: es-indexer

trpc:
extends:
file: docker-compose.discovery.prod.yml
Expand All @@ -31,6 +32,11 @@ services:
file: docker-compose.discovery.prod.yml
service: discovery-provider-elasticsearch

discovery-provider-openresty:
extends:
file: docker-compose.discovery.prod.yml
service: discovery-provider-openresty

discovery-provider:
extends:
file: docker-compose.discovery.prod.yml
Expand Down
6 changes: 6 additions & 0 deletions dev-tools/compose/docker-compose.discovery.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ services:
profiles:
- notifications

discovery-provider-openresty:
build:
context: ${PROJECT_ROOT}/packages/discovery-provider
dockerfile: Dockerfile.nginx
restart: unless-stopped

comms:
build:
context: ${PROJECT_ROOT}/comms
Expand Down
6 changes: 6 additions & 0 deletions dev-tools/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ services:
service: discovery-provider
<<: *common

discovery-provider-openresty:
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
service: discovery-provider-openresty
<<: *common

comms:
# Used for pushing to docker hub in CI
extends:
Expand Down
46 changes: 46 additions & 0 deletions packages/discovery-provider/Dockerfile.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM alpine:3.18

ENV INSTALL_PATH /audius-discovery-provider
WORKDIR $INSTALL_PATH

ENV PROMETHEUS_MULTIPROC_DIR /prometheus_data
RUN mkdir -p ${PROMETHEUS_MULTIPROC_DIR}

# Add the wait script to the image
# Script originally from https://github.com/ufoscout/docker-compose-wait/releases/download/2.4.0/wait
COPY scripts/wait /wait

RUN apk update && \
apk add --no-cache \
alpine-sdk \
bash \
curl \
docker \
libffi-dev \
libseccomp-dev \
libxml2-dev \
libxslt-dev \
linux-headers \
rsyslog \
sudo \
gcc \
python3 \
musl-dev


RUN curl -O 'http://openresty.org/package/admin@openresty.com-5ea678a6.rsa.pub' && \
mv 'admin@openresty.com-5ea678a6.rsa.pub' /etc/apk/keys/ && \
echo "http://openresty.org/package/alpine/v3.15/main" | tee -a /etc/apk/repositories && \
apk update && \
apk add openresty=1.21.4.3-r0 openresty-opm && \
opm get spacewander/lua-resty-rsa && \
opm get ledgetech/lua-resty-http && \
opm get bsiara/dkjson && \
mkdir /usr/local/openresty/conf /usr/local/openresty/logs

COPY nginx_conf /usr/local/openresty/conf/
COPY scripts scripts/

EXPOSE 5000

CMD ["bash", "scripts/openresty.sh"]
Loading

0 comments on commit f5cee04

Please sign in to comment.