-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
98 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
Oops, something went wrong.