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

Publish official Docker image #920

Open
mjpowersjr opened this issue May 27, 2024 · 3 comments
Open

Publish official Docker image #920

mjpowersjr opened this issue May 27, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mjpowersjr
Copy link

I'm using counterfact while writing integration tests with Jest. Before my tests begin, I launch a few local Docker containers using the testcontainers project. I wrote a small Dockerfile to run counterfact inside a container, but I need to build the image as part of my test setup. It would be nice if there was an official image I could use, and skip the build step.

There is one related issue that I hit while running counterfact inside a container. Initially I wanted to just bind mount my api schema, and existing generated counterfact code into the container (as a read-only mount). This didn't work, because counterfact was trying to write to the .cache directory from within the container. I believe allowing customization of the .cache directory would help.

Dockerfile

FROM node:20-alpine

RUN mkdir /app

RUN npm add -g counterfact

USER node
WORKDIR /app

ENTRYPOINT [ "counterfact" ]
@pmcelhaney
Copy link
Owner

Thanks for the suggestion. I'll add the Docker image. (Or if you open a pull request, I'll gladly merge it. :))

By "customization of the .cache directory", do you mean a CLI flag like --cache /somewhere/out/of/the/way? I'm happy to add that.

@pmcelhaney
Copy link
Owner

Also, would it suffice to drop the Dockerfile into the root of the project or do you need it to be published to some repository?

@pmcelhaney
Copy link
Owner

@mjpowersjr checking in to see if you have any other thoughts. I saw you forked the repo and had started to make some improvements. I would love the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants