-
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.
add back package.json from source. Add back docker build files
- Loading branch information
Showing
4 changed files
with
10,587 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/files/ | ||
/source/voyager/docs/ | ||
**/dist/ | ||
**/node_modules/ | ||
**/.git/ | ||
*.tar.gz |
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 |
---|---|---|
@@ -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 |
Oops, something went wrong.