Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Removing the function of the start script on the server for now, upda…
Browse files Browse the repository at this point in the history
…ting dockerfile to include only the needed files and work with the new structure, created .dockerignore
  • Loading branch information
[email protected] authored and [email protected] committed Apr 26, 2021
1 parent 7b210d0 commit 5cff776
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
node_modules
coverage
.github
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM node:14 as build

FROM node:14 as build-backend
WORKDIR /app
COPY ./td.server/package* ./
RUN npm ci --only=production


COPY package.json .
FROM node:14 as build-frontend
WORKDIR /app
COPY package* ./
RUN npm ci --only=production

RUN npm install

FROM gcr.io/distroless/nodejs:14
COPY --from=build /app /app
WORKDIR /app
COPY . .
CMD ["server.js"]

COPY server.js .
COPY ./td.server/src /app/td.server/src
COPY --from=build-backend /app /app/td.server/src
COPY ./td.site /app/td.site
COPY --from=build-frontend /app /app

CMD ["server.js"]
2 changes: 1 addition & 1 deletion td.server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.3.1",
"private": false,
"scripts": {
"start": "node server.js",
"start": "echo 'Please run npm run start from the root of this repo' && exit 1",
"pretest": "jshint --verbose --show-non-errors src",
"test": "istanbul cover --include-all-sources -x ./test --root ./src --dir ../coverage/Server/ ./test/support/jasmine-runner.js",
"codecov": "./node_modules/.bin/codecov"
Expand Down

0 comments on commit 5cff776

Please sign in to comment.