Skip to content

Commit cea195e

Browse files
committed
revise api and tasks build
No longer webpack bundled - just copied straight in and used is
1 parent 6c7390f commit cea195e

6 files changed

+9
-110
lines changed

Dockerfile.api-build

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
FROM --platform=$TARGETPLATFORM node:18-bullseye AS api-builder
2-
WORKDIR /srv
3-
COPY api/ /srv/
4-
RUN npm install
5-
RUN npm run build:production
6-
71
FROM --platform=$TARGETPLATFORM node:18-bullseye-slim
8-
WORKDIR /srv/api
92
LABEL org.opencontainers.image.source=https://github.com/CoEDL/nyingarn-workspace
103
LABEL org.opencontainers.image.description="The Nyingarn Workspace API container"
114
LABEL org.opencontainers.image.licenses=GPLv3
125

136
RUN apt-get update && apt-get install -y postgresql-client ca-certificates
14-
COPY --from=api-builder /srv/dist/package.json /srv/api/package.json
15-
COPY --from=api-builder /srv/dist/package-lock.json /srv/api/package-lock.json
7+
COPY api /srv/api
168
COPY scripts/wait-for-postgres.sh /srv/api/wait-for-postgres.sh
9+
WORKDIR /srv/api
1710
RUN npm install
18-
COPY --from=api-builder /srv/dist/ /srv/api/
19-
CMD [ "/srv/api/wait-for-postgres.sh", "node", "./server.bundle.js" ]
11+
CMD [ "/srv/api/wait-for-postgres.sh", "node", "/srv/api/index.js" ]

Dockerfile.tasks-build

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
FROM --platform=$TARGETPLATFORM node:18-bullseye AS tasks-builder
2-
COPY tasks /srv/tasks
3-
COPY api /srv/api
4-
WORKDIR /srv/tasks
5-
RUN npm install
6-
RUN npm run build:production
7-
81
FROM node:18-bullseye-slim
9-
WORKDIR /srv
102
LABEL org.opencontainers.image.source=https://github.com/CoEDL/nyingarn-workspace
113
LABEL org.opencontainers.image.description="The Nyingarn Workspace Tasks container"
124
LABEL org.opencontainers.image.licenses=GPLv3
135

14-
RUN apt-get update && apt-get install -y ca-certificates
15-
COPY --from=tasks-builder /srv/tasks/package.json /srv/package.json
16-
COPY --from=tasks-builder /srv/tasks/package-lock.json /srv/package-lock.json
6+
RUN apt-get update && apt-get install -y postgresql-client ca-certificates
7+
COPY tasks /srv/tasks
8+
COPY api /srv/api
9+
WORKDIR /srv/tasks
1710
RUN npm install
18-
COPY --from=tasks-builder /srv/tasks/dist/ /srv/
19-
COPY tasks/src/xslt /srv/tasks/src/xslt
20-
CMD [ "node", "./server.bundle.js" ]
11+
CMD [ "node", "/srv/tasks/index.js" ]

api/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"develop:server": "npm install && sleep 10 && npm run load:datapacks && ./node_modules/.bin/nodemon --exec babel-node ./index.js",
1212
"test": "./node_modules/.bin/jest --runInBand",
1313
"test:watch": "./node_modules/.bin/jest --watch --runInBand",
14-
"build:production": "./node_modules/.bin/webpack --config webpack.production.cjs",
1514
"load:datapacks": "sleep 10 && node ./load-data-packs.js"
1615
},
1716
"devDependencies": {

api/webpack.production.cjs

-41
This file was deleted.

tasks/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"develop": "npm run develop:server",
1111
"develop:server": "npm install && ./node_modules/.bin/nodemon --exec babel-node ./index.js",
1212
"test": "./node_modules/.bin/jest --runInBand",
13-
"test:watch": "./node_modules/.bin/jest --watch --runInBand",
14-
"build:production": "./node_modules/.bin/webpack --config webpack.production.cjs"
13+
"test:watch": "./node_modules/.bin/jest --watch --runInBand"
1514
},
1615
"devDependencies": {
1716
"@babel/cli": "^7.19.3",

tasks/webpack.production.cjs

-41
This file was deleted.

0 commit comments

Comments
 (0)