-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new build dockerfile, adding packageManager, basic turbo integ…
…ration to get prune Signed-off-by: Peter Baker <[email protected]>
- Loading branch information
1 parent
186a631
commit 55f4693
Showing
11 changed files
with
75 additions
and
7 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ infrastructure/ | |
docs/ | ||
node_modules/ | ||
tests/ | ||
.env | ||
.env | ||
out |
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
keys | ||
build | ||
.turbo | ||
.turbo | ||
out |
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,58 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# BASED ON https://turbo.build/repo/docs/guides/tools/docker | ||
|
||
FROM node:20-alpine as base | ||
|
||
FROM base as builder | ||
|
||
RUN apk update | ||
RUN apk add --no-cache libc6-compat | ||
|
||
# work in /app folder | ||
WORKDIR /app | ||
|
||
# install turbo global | ||
RUN npm install turbo@^2.0.11 -g | ||
|
||
# copy everything into builder | ||
COPY . . | ||
|
||
# prune using turbo for only faims3 and it's dependencies | ||
RUN turbo prune @faims3-project/conductor --docker | ||
|
||
# add lockfiles dependencies | ||
FROM base as installer | ||
RUN apk update | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY .gitignore .gitignore | ||
COPY --from=builder /app/out/json/ . | ||
COPY --from=builder /app/out/package-lock.json ./package-lock.json | ||
# COPY --from=builder /app/out/full/library/data-model/tsconfig.json ./library/data-model/tsconfig.json | ||
RUN npm install | ||
|
||
# Build the project | ||
COPY --from=builder /app/out/full/ . | ||
|
||
# TODO use turbo build here and filter for app | ||
RUN npm run build-api | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
# Don't run production as root | ||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 faims | ||
USER faims | ||
|
||
# Need all of these files from the installer step to run | ||
|
||
# The build output | ||
COPY --from=installer --chown=faims:nodejs /app/api/build ./build | ||
# Installed node modules | ||
COPY --from=installer --chown=faims:nodejs /app/node_modules ./node_modules | ||
|
||
CMD node ./build/src/index.js |
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
{ | ||
"name": "@faims-project/conductor", | ||
"name": "@faims3-project/conductor", | ||
"version": "0.1.0", | ||
"private": true, | ||
"main": "build/src/index.js", | ||
"packageManager": "", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"lint": "gts lint", | ||
"clean": "gts clean", | ||
"compile": "tsc", | ||
"build": "tsc", | ||
"fix": "gts fix", | ||
"prestart": "npm run-script compile", | ||
"start": "node .", | ||
"start:prod": "node build/src/index.js", | ||
"local": "env-cmd nodemon --ignore build --ext ts --exec 'tsc --incremental && node .'", | ||
"watch": "nodemon --ignore build --ext ts --exec 'tsc --incremental && node .'", | ||
"initdb": "env-cmd node scripts/initialise.js", | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "@faims-project/faims3", | ||
"packageManager": "[email protected]", | ||
"version": "0.9.0", | ||
"private": true, | ||
"engines": { | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "faims3-notebook-designer", | ||
"packageManager": "[email protected]", | ||
"private": true, | ||
"version": "0.0.1", | ||
"type": "module", | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "aws-cdk-faims-infra", | ||
"packageManager": "[email protected]", | ||
"version": "0.1.0", | ||
"bin": { | ||
"aws-cdk-faims-infra": "bin/aws-cdk-faims-infra.js" | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "faims3-datamodel", | ||
"packageManager": "[email protected]", | ||
"version": "1.1.6", | ||
"description": "Database access layer for FAIMS3", | ||
"main": "./build/src/index.js", | ||
|
@@ -11,7 +12,6 @@ | |
"build/" | ||
], | ||
"scripts": { | ||
"prepare": "npm run build", | ||
"build": "tsc -p tsconfig.json", | ||
"test": "NODE_ENV=test jest", | ||
"test:watch": "NODE_ENV=test jest --watchAll=true", | ||
|
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
], | ||
"scripts": { | ||
"build-app": "npm run build --workspace=app", | ||
"build-api": "npm run build --workspace=api", | ||
"build-aws": "npm run build --workspace=infrastructure/aws-cdk", | ||
"package-aws": "npm run package --workspace=infrastructure/aws-cdk", | ||
"test-app": "npm test --workspace=app", | ||
|
@@ -28,5 +29,6 @@ | |
"description": "", | ||
"devDependencies": { | ||
"turbo": "^2.0.11" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "FAIMS3-QA", | ||
"packageManager": "[email protected]", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
|