Skip to content

Commit

Permalink
Revert "[⚠️] Clean up discovery node build artifacts and URSM code (#…
Browse files Browse the repository at this point in the history
…8234)"

This reverts commit bd2fbc3.
  • Loading branch information
sliptype committed May 2, 2024
1 parent a928457 commit 3c6d4f4
Show file tree
Hide file tree
Showing 20 changed files with 1,311 additions and 6 deletions.
1 change: 1 addition & 0 deletions dev-tools/compose/docker-compose.discovery.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ services:
audius_discprov_dev_mode: 'true'
audius_discprov_loglevel: 'debug'
volumes:
- ${PROJECT_ROOT}/packages/discovery-provider/alembic:/audius-discovery-provider/alembic
- ${PROJECT_ROOT}/packages/discovery-provider/src:/audius-discovery-provider/src
- ${PROJECT_ROOT}/dev-tools:/tmp/dev-tools
healthcheck:
Expand Down
13 changes: 13 additions & 0 deletions packages/discovery-provider/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Pretty much the same as the Dockerfile.prod but assumes the whole
# discovery-provider package is a mounted volume instead of copying everything.
FROM audius/contracts:1.0.0 AS contracts
FROM alpine:3.18

WORKDIR /app/packages/discovery-provider

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
Expand Down Expand Up @@ -63,6 +67,8 @@ RUN python3 -m pip install --upgrade pip
COPY scripts/init-db.sh scripts/init-db.sh
RUN bash scripts/init-db.sh

COPY --from=contracts /usr/src/app/build/contracts/ build/contracts/

COPY requirements.txt requirements.txt
RUN --mount=type=cache,target=/root/.cache \
python3 -m pip install -r requirements.txt --no-cache-dir
Expand All @@ -71,7 +77,14 @@ COPY nginx_conf /usr/local/openresty/conf/

# ARGs can be optionally defined with --build-arg while doing docker build eg in CI and then set to env vars
ARG git_sha
ARG audius_loggly_disable
ARG audius_loggly_token
ARG audius_loggly_tags

ENV GIT_SHA=$git_sha
ENV audius_loggly_disable=$audius_loggly_disable
ENV audius_loggly_token=$audius_loggly_token
ENV audius_loggly_tags=$audius_loggly_tags

EXPOSE 5000

Expand Down
11 changes: 11 additions & 0 deletions packages/discovery-provider/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM audius/contracts:1.0.0 AS contracts
FROM alpine:3.18

ENV INSTALL_PATH /audius-discovery-provider
Expand Down Expand Up @@ -64,6 +65,8 @@ RUN python3 -m pip install --upgrade pip
COPY scripts/init-db.sh scripts/init-db.sh
RUN bash scripts/init-db.sh

COPY --from=contracts /usr/src/app/build/contracts/ build/contracts/

COPY requirements.txt requirements.txt
RUN --mount=type=cache,target=/root/.cache \
python3 -m pip install -r requirements.txt --no-cache-dir
Expand All @@ -72,8 +75,16 @@ COPY . .

COPY nginx_conf /usr/local/openresty/conf/

# ARGs can be optionally defined with --build-arg while doing docker build eg in CI and then set to env vars
ARG git_sha
ARG audius_loggly_disable
ARG audius_loggly_token
ARG audius_loggly_tags

ENV GIT_SHA=$git_sha
ENV audius_loggly_disable=$audius_loggly_disable
ENV audius_loggly_token=$audius_loggly_token
ENV audius_loggly_tags=$audius_loggly_tags

EXPOSE 5000

Expand Down
Loading

0 comments on commit 3c6d4f4

Please sign in to comment.