Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown converter microservices #358

Closed
wants to merge 7 commits into from
Closed
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
12 changes: 12 additions & 0 deletions bin/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ docker_build(
]
)


docker_build(
'localhost:5001/impress-blocknote:latest',
context='..',
dockerfile='../src/blocknote/Dockerfile',
only=['./src/blocknote', './docker', './.dockerignore'],
target = 'production',
live_update=[
sync('../src/blocknote', '/home/blocknote'),
]
)

k8s_yaml(local('cd ../src/helm && helmfile -n impress -e dev template .'))

migration = '''
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ services:
ports:
- "3000:3000"

blocknote-converter:
user: "${DOCKER_USER:-1000}"
build:
context: .
dockerfile: ./src/blocknote/Dockerfile
target: production
image: blocknote:blocknote-production
ports:
- "8081:8081"

dockerize:
image: jwilder/dockerize

Expand Down
5 changes: 5 additions & 0 deletions src/blocknote/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"trailingComma": "es5",
"singleQuote": true
}
28 changes: 28 additions & 0 deletions src/blocknote/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:20-alpine AS dependencies

WORKDIR /home/blocknote

COPY ./src/blocknote/package*.json ./

RUN npm install

COPY .dockerignore ./.dockerignore
COPY ./src/blocknote/ .

FROM dependencies AS blocknote-builder

WORKDIR /home/blocknote

RUN npm run build

# ---- Blocknote image ----
FROM blocknote-builder AS production

# Un-privileged user running the application
ARG DOCKER_USER
USER ${DOCKER_USER}

COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint

ENTRYPOINT ["/usr/local/bin/entrypoint"]
CMD ["npm", "run", "start"]
5 changes: 5 additions & 0 deletions src/blocknote/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["src"],
"ext": "ts",
"exec": "concurrently \"npx tsc --watch\" \"ts-node src/index.ts\""
}
Loading
Loading