Skip to content

Commit

Permalink
Enhance Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed May 7, 2024
1 parent e5bb0ab commit 706c655
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
FROM searxng/searxng:2024.4.29-e45a7cc06

ENV PORT ${PORT:-7860}
EXPOSE ${PORT}
RUN apk add --update \

RUN apk add --update --no-cache \
nodejs \
npm \
git

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 /etc/searxng \
&& chmod 777 /etc/searxng

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

USER ${USERNAME}
WORKDIR /home/${USERNAME}/app

COPY --chown=${USERNAME}:${USERNAME} package*.json ./
RUN npm ci

COPY --chown=${USERNAME}:${USERNAME} . .
RUN npm ci \
&& npm run build
ENTRYPOINT [ "/bin/sh", "-c" ]
CMD [ "/usr/local/searxng/dockerfiles/docker-entrypoint.sh -f & npm start -- --host" ]
RUN npm run build

ENTRYPOINT ["/bin/sh", "-c"]
CMD ["/usr/local/searxng/dockerfiles/docker-entrypoint.sh -f & npm start -- --host"]

0 comments on commit 706c655

Please sign in to comment.