-
Notifications
You must be signed in to change notification settings - Fork 37
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
Look into making a Docker image for APEX Nitro #231
Comments
Problem is: how do we expose the apex-nitro CLI to the host after the container is running? This thread has a solution to a similar problem: https://stackoverflow.com/questions/43472039/how-to-run-nodejs-command-line-tools-inside-docker is having a similar problem, but they are using |
The CLI would be this container? The container wouldn't be running before you do Other obstacles:
What "dependency" is allowed? The first two could be done with a bash script, # Module name would be the second argument in most (all?) cases
export $MODULE_NAME=$2
export $MODULE_FOLDER=`.${$MODULE_NAME}/`
if [ $APPDATA ]
then
export $NODE_PACKAGE_CONFIGURATOR_FOLDER="${APPDATA}/${MODULE_FOLDER}"
elif [[ "$OSTYPE" == "darwin"* ]]; then
export $NODE_PACKAGE_CONFIGURATOR_FOLDER="${HOME}/Library/Preferences/${MODULE_FOLDER}"
else
export $NODE_PACKAGE_CONFIGURATOR_FOLDER="${HOME}/${MODULE_FOLDER}"
fi
export NODE_PACKAGE_CONFIGURATOR_FOLDER=
docker run \
\ # Will mount the config folder at /node_package_configurator
-v $NODE_PACKAGE_CONFIGURATOR_FOLDER="/app_home/${MODULE_FOLDER}" \
\ # Will mount the app folder (assuming it is the working directory) on /app
-v $PWD=/app \
\ # We can, I think, assume nothing will be running, so ports will be 4000, 4001 and 4002
-p 4000:4000 \
-p 4001:4001 \
-p 4002:4002 \
apex-nitro "$@" # This will pass in all the arguments given to this bash script In this example, the There would be some more conversion or fiddling for setting the If you'd like I can give this a try, but it seems like a far stretch |
Thank you for these thoughtful considerations. You seem pretty knowledgable about both APEX Nitro & Docker, based on your acknowledgment of The obstacles are potentially game-breaking. If we are going to adopt Docker as an alternative to npm, it has to be simpler than npm. Before going further, what is your opinion about all this? |
Thanks, hahaha :) I think that in it's current form (using node-package-configurator) it will be hard, or at least more complicated than "just node/npm". Now I made a small apex-nitro clone that uses a per-project configuration file, a file that is stored WITH the project (and would be sent to git). The docker approach would work a lot better (and make more sense) if a project could be configured once, and then replicated easily. Right now, that would mean copy-ing over the files from/to If you'd decide to (make an option to) put the config file in the project, it would be pretty easy to make a docker image (the whole APPDATA part in the bash script could be skipped, only the project as a volume).
would create a config file
would use Problem with this approach, however, would be the fact you'd may not want to share your apex credentials. Maybe an (optional?!) extra file I hope I am not making you read too many lines of text, hahaha, but I have a hard time keeping my comments compact 😂
(A lot simpler than the bash script earlier :D) |
Maybe a bit off-topic here but...
I like this. We are working with multiple developers on 1 project and exporting/importing the config is kinda stupid when you have a Git-repo. Maybe discuss this in a separate issue? |
Sure thing! |
@martindsouza was there anything missing for full Docker support? |
Idea from Roel: https://twitter.com/RoelH/status/933673606344773632
Tasks:
The text was updated successfully, but these errors were encountered: