typesense / Dockerfile
thejagstudio's picture
Update Dockerfile
be05700 verified
raw
history blame
1.35 kB
FROM typesense/typesense:27.1
# Expose the default Typesense port
EXPOSE 8108
EXPOSE 7860
ENV PORT=7860
RUN rm -f /etc/apt/sources.list.d/*.list && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
sudo \
git \
wget \
procps \
git-lfs \
zip \
unzip \
htop \
vim \
nano \
bzip2 \
libx11-6 \
build-essential \
libsndfile-dev \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
RUN add-apt-repository ppa:flexiondotorg/nvtop && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends nvtop
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs && \
npm install -g configurable-http-proxy
# Set environment variables for Typesense
ENV TYPESENSE_DATA_DIR=/data
ENV TYPESENSE_API_KEY=Hu52dwsas2AdxdE
RUN adduser --disabled-password --gecos '' --shell /bin/bash user
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user
ENV HOME=/home/user
RUN mkdir $HOME/.cache $HOME/.config \
&& chmod -R 777 $HOME
USER root
RUN mkdir /data && chown user:user /data
USER user
# Set the working directory
WORKDIR /data
# Start Typesense server
CMD ["--data-dir", "/data", "--api-key=Hu52dwsas2AdxdE", "--listen-port", "7860","--enable-cors"]