Skip to content

Instantly share code, notes, and snippets.

@emptymalei
Last active January 21, 2021 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emptymalei/926f5ad55b45fe1a4deb6638bb241af2 to your computer and use it in GitHub Desktop.
Save emptymalei/926f5ad55b45fe1a4deb6638bb241af2 to your computer and use it in GitHub Desktop.
preload data into redis using python script
# This is an experiment
# It is not working
FROM redis:4.0.2-alpine
RUN apk add --no-cache python3 py3-pip
RUN pip3 install click
RUN pip3 install redis
RUN mkdir app
COPY . /app
EXPOSE 80
WORKDIR /app
ARG LUT_FILE_PATH=artifacts/lookup_table/
ARG LUT_FILE_NAME=lookup_table.json
RUN cd /app
RUN echo $LUT_FILE_PATH$LUT_FILE_NAME
COPY $LUT_FILE_PATH$LUT_FILE_NAME .
RUN ls .
RUN redis-server --daemonize yes
RUN redis-cli ping
RUN python3 api/prepare_redis.py --lut $LUT_FILE_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment