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

fix: update Dockerfile with python and .gyp to support install and run of Glee project in container #1208

Merged
merged 17 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM node:16-alpine
FROM node:20-alpine

ARG ASYNCAPI_CLI_VERSION=0.59.1
# docker build -t cli:20 . # to build image
derberg marked this conversation as resolved.
Show resolved Hide resolved
# docker compose up # to launch container with running studio, note you need to add a random asyncapi.yaml to ./output folder

# Create a non-root user
RUN addgroup -S myuser && adduser -S myuser -G myuser
Expand All @@ -14,11 +15,12 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Since 0.14.0 release of html-template chromium is needed for pdf generation.
# More custom packages for specific template should not be added to this dockerfile. Instead, we should come up with some extensibility solution.
RUN apk --update add git chromium && \
apk add --no-cache --virtual .gyp python3 make g++ && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*

# Installing latest released npm package
RUN npm install --ignore-scripts -g @asyncapi/cli@"$ASYNCAPI_CLI_VERSION"
RUN npm install --ignore-scripts -g @asyncapi/cli

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eelcofolkertsma you added ASYNCAPI_CLI_VERSION back in line 4 but it is still missing here - basically not used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fixed that one too
If you use Dockerfile without change you get latest version of cli. If you add a version-value you get image for that version of cli
Tested OK in Github codespaces (default version=1.7.3, forced version=1.7.2) with docker build -t cli . and docker run cli --version

# Switch to the non-root user
USER myuser
Expand Down
16 changes: 16 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we need a compose.yaml committed in the repo.
If it's needed I suggest to rename it to docker-compose.yaml
To be confirmed by current maintainers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do use the file in testing the viability of docker container (studio, glee), but test is far from trivial. I am very open to other test approach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File has been renamed as per suggestion and moved to location ./test/manual
Comment in Dockerfile has been adjusted accordingly (instructions for testing)


services:
studio:
image: cli:20
ports:
- "8081:3210"
volumes:
- ${PWD}/output:/app
networks:
- default
user: root
command: start studio

networks:
default: {}
Loading