Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Local Dev",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/enki,type=bind,consistency=default",
"mounts": [],
"workspaceFolder": "/workspace/enki"
}

// Commands to run when inside a devcontainer to get a PDF:
//
// npm --prefix ./bakery-js/ install
// npm --prefix ./bakery-js/ run build
// npm --prefix ./mathify/ install
//
// export $(cat cli.env | xargs)
// bash -xv ./dockerfiles/docker-entrypoint.sh all-pdf --repo tiny-book --book-slug book-slug-1 --ref main
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
[submodule "cnxml"]
path = cnxml
url = https://github.com/openstax/cnxml
[submodule "poet"]
path = poet
url = https://github.com/openstax/poet
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ COPY ./bakery-js/tsconfig*.json /workspace/enki/bakery-js/
RUN npm --prefix=/workspace/enki/bakery-js run build


COPY ./poet/package.json ./poet/package-lock.json ./poet/tsconfig*.json /workspace/enki/poet/
# Maybe don't need the client files
COPY ./poet/client/package.json ./poet/client/package-lock.json /workspace/enki/poet/client/
COPY ./poet/server/package.json ./poet/server/package-lock.json /workspace/enki/poet/server/

RUN npm --prefix=/workspace/enki/poet install

COPY ./poet/server/src/ /workspace/enki/poet/server/src/
COPY ./poet/common/src/ /workspace/enki/poet/common/src/
COPY ./poet/server/tsconfig*.json /workspace/enki/poet/server/
COPY ./poet/server/webpack.config.js /workspace/enki/poet/server/

# Just for notes: cd /workspace/enki/poet && ./node_modules/.bin/ts-node server/src/model/_cli.ts validate /tmp/build/0000000/_attic/IO_FETCHED
# RUN npm --prefix=/workspace/enki/poet run build:server


# ===========================
# Install Python Packages
# ===========================
Expand Down Expand Up @@ -348,6 +364,8 @@ COPY --from=build-python-stage \
/usr/local/bin/aws \
/usr/local/bin/

COPY --from=build-bakery-js-stage /workspace/enki/poet/ /workspace/enki/poet/


# Copy ce-styles
COPY ./ce-styles/styles/output/ /workspace/enki/ce-styles/styles/output/
Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/steps/step-fetch.bash
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ else
fi
fi


cd /workspace/enki/poet && ./node_modules/.bin/ts-node server/src/model/_cli.ts validate "$IO_FETCHED"

# Clean up the temporary credentials file if it exists
if [[ -f $creds_dir ]]; then
rm -rf $creds_dir # LCOV_EXCL_LINE
Expand Down
1 change: 1 addition & 0 deletions poet
Submodule poet added at 268812