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

Docker - Optimize for development through Docker environment #299

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MarjanDB
Copy link
Contributor

I do not like running things locally.
As a result, I cleaned up the Dockerfile to have a production and development build steps that can be targeted. The production build is the same as before, while the development build has all development dependencies installed and runs vue-cli-service serve --port 8082 by default.
While I was at it, I also added some Dockerfile arguments for the node and alpine versions.

Since the Dockerfile now has a production and development build, you have to target the production step explicitly. If you don't, the development build will be produced. To help with that, I added a Makefile with rules for building production and development images. I also added rules for starting and removing the docker environment as defined in the docker/docker-compose.yml file.

I also made sure to update the docker/build-push-action@v3 workflow action to target the production build step.
See: https://github.com/docker/build-push-action?tab=readme-ov-file#inputs

I wasn't able to test if this target field works as expected, so that's something that has to be verified.
I did test the image building and running for both production and development targets.

@KlausSchaefers
Copy link
Owner

Does the git actions work in your repo (except publishing). Still I was wondering why would you want a development build?

@MarjanDB
Copy link
Contributor Author

@KlausSchaefers

Does the git actions work in your repo (except publishing). Still I was wondering why would you want a development build?

I don't think I can test the action without creating my own dockerhub account and all that stuff to replace variables.

As for why, I'm running the entire thing through docker to keep everything on the docker network created for quant. When doing that, dev stuff has to be installed to be able to run vue's serve command. Then again, I could also exec directly into the container and manually install dev dependencies and restart the container... just thought it'd be cool to have it setup like this from the start. I could also just add all of the steps to the README and forego modify the dockerfile.

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

Successfully merging this pull request may close these issues.

2 participants