diff --git a/apps/software-stories/Dockerfile b/apps/software-stories/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..078e3d50264805ed0289862542a530672117a54d --- /dev/null +++ b/apps/software-stories/Dockerfile @@ -0,0 +1,22 @@ +FROM node:19-bullseye + +RUN apt-get -y update && \ + apt-get -y upgrade && \ + npm install -g serve && \ + mkdir -p /opt/swh/swh-stories && \ + chown -R node:node /opt/swh + +USER node +ENV NODE_OPTIONS=--openssl-legacy-provider +WORKDIR /opt/swh/swh-stories + +COPY --chown=node:node entrypoint.sh /opt/swh + +RUN chmod u+x /opt/swh/entrypoint.sh && \ + git clone https://github.com/ScienceStories/swh-stories.git /opt/swh/swh-stories && \ + git checkout 04168585b48edb77b3410cfe0e5e06af545bb18c && \ + rm package-lock.json && \ + npm install --no-audit && \ + npm run build + +ENTRYPOINT "/opt/swh/entrypoint.sh" diff --git a/apps/software-stories/entrypoint.sh b/apps/software-stories/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..fc0fdc7ea772c993a150d42a32b75166f922ae02 --- /dev/null +++ b/apps/software-stories/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +case "$1" in + "shell") + shift + echo "Running command $@" + exec bash -i "$@" + ;; + *) + exec serve -s build + ;; +esac