Skip to content

Commit

Permalink
LIT: Use ENV VAR=value form in Dockerfiles
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 673814234
  • Loading branch information
RyanMullins authored and LIT team committed Sep 12, 2024
1 parent 8dbf16b commit e13772a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | \
RUN apt update && apt -y install yarn

# Copy local code to the container image.
ENV APP_HOME /app
ENV APP_HOME=/app
WORKDIR $APP_HOME

# Set up python environment with production dependencies
Expand All @@ -40,7 +40,7 @@ COPY . ./

# Build front-end with yarn
WORKDIR $APP_HOME/lit_nlp/client
ENV NODE_OPTIONS "--openssl-legacy-provider"
ENV NODE_OPTIONS="--openssl-legacy-provider"
RUN yarn && yarn build && rm -rf node_modules/*

# Run LIT server
Expand Down
11 changes: 5 additions & 6 deletions lit_nlp/examples/vertexai/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN apt-get update
RUN apt-get install -y wget curl gnupg2 gcc g++ git

# Copy local code to the container image.
ENV APP_HOME /app
ENV APP_HOME=/app
WORKDIR $APP_HOME

COPY ./lit_nlp/examples/vertexai/gunicorn_config.py ./
Expand Down Expand Up @@ -57,21 +57,20 @@ RUN apt update && apt -y install yarn
# Set up python environment with production dependencies
# This step is slow as it installs many packages.
COPY requirements_core.txt ./
RUN python -m pip install -r requirements_core.txt

COPY lit_nlp/examples/vertexai/requirements.txt lit_nlp/examples/vertexai/requirements.txt
COPY lit_nlp/examples/vertexai/requirements.txt \
lit_nlp/examples/vertexai/requirements.txt
RUN python -m pip install -r lit_nlp/examples/vertexai/requirements.txt

# Copy the rest of the lit_nlp package
COPY . ./

# Build front-end with yarn
WORKDIR $APP_HOME/lit_nlp/client
ENV NODE_OPTIONS "--openssl-legacy-provider"
ENV NODE_OPTIONS="--openssl-legacy-provider"
RUN yarn && yarn build && rm -rf node_modules/*

# Run LIT server
# Note that the config file supports configuring the LIT demo that is launched
# via the DEMO_NAME and DEMO_PORT environment variables.
WORKDIR $APP_HOME
ENTRYPOINT ["gunicorn", "--config=gunicorn_config.py"]
ENTRYPOINT ["gunicorn", "--config=gunicorn_config.py"]

0 comments on commit e13772a

Please sign in to comment.