Skip to content

Commit

Permalink
WIP troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed May 22, 2024
1 parent 0cf0009 commit 3a8701c
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 257 deletions.
59 changes: 18 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,49 +1,26 @@
# Use the latest SearXNG image as the base
FROM searxng/searxng:latest

# Install necessary dependencies
RUN apk add --no-cache nodejs npm git certbot

FROM searxng/searxng:2024.5.10-901819359
ENV PORT ${PORT:-7860}
EXPOSE ${PORT}
RUN apk add --update \
nodejs \
npm \
git
ARG SEARXNG_SETTINGS_FOLDER=/etc/searxng
RUN sed -i 's/- html/- json/' /usr/local/searxng/searx/settings.yml \
&& sed -i 's/su-exec searxng:searxng //' /usr/local/searxng/dockerfiles/docker-entrypoint.sh \
&& mkdir -p ${SEARXNG_SETTINGS_FOLDER} \
&& mkdir -p ${SEARXNG_SETTINGS_FOLDER} \
&& chmod 777 ${SEARXNG_SETTINGS_FOLDER}

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Copy the .npmrc file
COPY ./.npmrc ./.npmrc

# Copy the custom SearXNG settings file
COPY custom-settings.yml ${SEARXNG_SETTINGS_FOLDER}/settings.yml

# Install Node.js dependencies
ARG USERNAME=user
RUN adduser -D -u 1000 ${USERNAME} \
&& mkdir -p /home/${USERNAME}/app \
&& chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
USER user
WORKDIR /home/${USERNAME}/app
COPY --chown=${USERNAME}:${USERNAME} ./package.json ./package.json
COPY --chown=${USERNAME}:${USERNAME} ./package-lock.json ./package-lock.json
COPY --chown=${USERNAME}:${USERNAME} ./.npmrc ./.npmrc
RUN npm ci

# Copy the application code
COPY . .

# Build the application
COPY --chown=${USERNAME}:${USERNAME} . .
RUN npm run build

# Create directory for SSL certificate and key
RUN mkdir -p /app/ssl

# Set higher timeout values for SearXNG
ENV SEARXNG_TIMEOUT_ALL=120
ENV SEARXNG_TIMEOUT_SPECIFIC="soundcloud=120 wikidata=120"

# Expose HTTP and HTTPS ports
ENV PORT ${PORT:-7860}
EXPOSE ${PORT}
EXPOSE 80
EXPOSE 443

# Set the entrypoint command
ENTRYPOINT [ "/bin/sh", "-c" ]
CMD [ "/usr/local/searxng/dockerfiles/docker-entrypoint.sh -f & touch /etc/searxng/limiter.toml & npm start -- --host" ]
Loading

0 comments on commit 3a8701c

Please sign in to comment.