Skip to content

Commit

Permalink
add back package.json from source. Add back docker build files
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Jan 5, 2024
1 parent 1c79107 commit 51267d3
Show file tree
Hide file tree
Showing 4 changed files with 10,587 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/files/
/source/voyager/docs/
**/dist/
**/node_modules/
**/.git/
*.tar.gz
63 changes: 63 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

FROM node:16-alpine as build
RUN mkdir -p /app/dist /app/source
WORKDIR /app

COPY source/server/package*.json /app/source/server/
RUN (cd /app/source/server && npm ci)

COPY source/voyager/package*.json /app/source/voyager/
RUN (cd /app/source/voyager && npm ci)

COPY source/ui/package*.json /app/source/ui/
RUN (cd /app/source/ui && npm ci)

COPY ./package*.json /app/
RUN npm ci


COPY source/server /app/source/server
RUN npm run build-server
# outputs files in /app/source/server/dist

COPY source/voyager /app/source/voyager
RUN npm run build-voyager
# files are automatically picked up by build-ui

COPY source/ui /app/source/ui
RUN npm run build-ui
# outputs files in /app/dist



###################
# The actual container to be published
###################
FROM node:16-alpine
LABEL org.opencontainers.image.source=https://github.com/Holusion/e-thesaurus
LABEL org.opencontainers.image.description="eCorpus base image"
LABEL org.opencontainers.image.licenses=Apache

ARG PORT=8000

ENV PUBLIC=false
ENV PORT=${PORT}
ENV NODE_ENV=production

WORKDIR /app
COPY source/server/package*.json /app/
#might occasionally fail if the prebuilt version can't be downloaded,
# because it can't rebuild it locally
RUN npm ci --omit=dev

COPY ./source/server/migrations /app/migrations
COPY ./source/server/templates /app/templates


COPY --from=build /app/dist /app/dist
COPY --from=build /app/source/server/dist/server /app/server

VOLUME [ "/app/files" ]
EXPOSE ${PORT}

CMD node server/index.js
Loading

0 comments on commit 51267d3

Please sign in to comment.