-
Notifications
You must be signed in to change notification settings - Fork 35
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 container for Gin #35
Comments
Thank you for the suggestion. How would you recommend to allow users create and edit gin apps? Add an editor in the container (vim for instance)? Mount the volume in the host? |
I don't know Gin enough to suggest an ideal solution. My goal would be keeping the Gin container as independent as possible from the app and the database.
After I can initialize the app running
this should create the app in the What I don't know is if OpenResty watches the code and updates the output in real time or has to be restarted in some way. In the second case, the approach would require something like
Anyway, this is pure speculation. I don't really know how Gin works because I was unable to install it. Consider it just as a general suggestion. |
Also, I guess that you can build the docker container starting FROM the openresty container |
I did some work on this. It did require making some changes to Gin to accommodate running in a Docker container. My changes can be viewed here master...StevenWarren:docker I would like to make this an alpine image but had some build issues so used Unbuntu Xenial instead. This brings the image to around 550mb. Will look at reducing that later. NOTE: This is still very much a WIP Docker image: https://hub.docker.com/r/manicapps/gin/ UsageCreate project root directory Create new appFrom project root run
Your newly created app will be in the app directory. You may now edit those files and the changes will reflect in the Docker container so long as you mount the volume. Run tests
Gin will complain about port 7021 but still runs the tests properly. Need to investigate further to see why the error is thrown. Docker-compose exampleIn your project root create a docker-compose.yml file.
In the project root run
Optionally add "-d" to run as deamon. |
Apologies to anyone who already tested the image, I accidentally pushed the wrong image to docker hub. It has been corrected and the proper image is now available. |
@StevenWarren Do you mind sharing your Dockerfile please? |
I tried to install Gin on my Macbook without success (for example,
brew pcre
fails).After I tried to install it on Linux and it was even worse.
A docker container would be very useful because someone can start using Gin without caring about the complications or installs and configurations.
The text was updated successfully, but these errors were encountered: