-
Notifications
You must be signed in to change notification settings - Fork 12
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
WIP: Docker containers #75
Conversation
Split back-end into own directory to be its own image
- Individual image Dockerfiles for front-end added; not successfully run yet, but they build without error - docker-compose to run both images in a container; also not yet successful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See a smattering of comments below. The big change which seems to have linked the two is in front-end/Dockerfile
and front-end/package.json
, which switches the proxy from "localhost" to "back-end" (the name of the Docker service).
- Change COPY path directives - Add environment creation for temporary key - Missed `python` in CMD - Re-adding `dotenv` usage - `ALLOWED_HOSTS` filled in - Version of `docker-compose` - Adding `bash -c` for directory change assistance - Added `links` for back-end - Changing front-end proxy
I pushed a few tweaks, all minor things (a missing hypen, quotes, and a backslash)! This now works for me with
and
|
- Changing to lighter-weight node base image - Removing extra `cd` that misses `manage.py` - Added .dockerignore for perf improvements
A few more changes. Still having this one issue:
@reelmatt can you check on the GET I will also double back when this gets resolved to fix up the Postman Tests that are surely failing with the directory changes for |
docker-compose.yml
Outdated
@@ -6,7 +6,9 @@ services: | |||
- ./back-end:/visual-programming/back-end | |||
ports: | |||
- "8000:8000" | |||
command: bash -c "cd vp && pipenv run python manage.py runserver 0.0.0.0:8000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my machine at least I need this extra cd vp
part of the command. I think this is because the docker-compose.yml
donesn't the have same/similar line that the individual Dockerfile
has of WORKDIR /..../vp
to change it.
Reverting back to cd vp && pipenv ...
still runs for me with the other changes you made.
@matthew-t-smith We may be having some differences with where directories are being located in the Docker container. Made a comment about adding the The issue with I know @reddigari has done a lot of front-end improvements in the mean time, so I think it might be easier to make a change in one of his open PRs, or make the change after this PR is merged to reduce conflict headaches. Re: testing, I think it's actually a problem with the pyworkflow unit tests. If I add |
This *should* pass the automated tests
@matthew-t-smith I committed the changes to fix the GitHub Action runner; it now finds and passes the tests. Have you looked into the discrepancy between including |
A little confused by the volume mounts in |
Just a thought: would it be possible to include an option for a user to mount their own custom nodes directory into the pyworkflow custom nodes location? They could store their nodes locally and then have access to them as soon as the container is running as opposed to manually uploading each one, and having them disappear when the container restarts. |
@reelmatt - I think I have an idea on the directory issue. I’ll do some testing Sunday to be sure. @reddigari - the directory mounts were largely following some other samples. I’ll double check on those. The node modules should be ignored in the images so the container is lighter, but I will make sure that’s actually happening. Also, not sure on the option of loading into the container’s directory structure. Interesting, but once I get this updated, I can see. |
As far as I understand it (which is without much dev ops experience), the volume mounts are so a running container reflects changes you make locally without having to rebuild. But the image we upload for people to pull and run needs to have the released source code copied (and dependencies installed). That's what's handled by the Using build args to decide whether to run the |
Abandoning in favor of PR #84 |
This contains the work @matthew-t-smith did on Dockerizing the front-/back-ends. Please include/correct anything that might be missing!
Build each end separately:
cd
into theback-end
orfront-end
directoriesdocker build --tag backendtest:1.0 .
docker run -p 8000:8000 --name <name> backendtest:1.0
Note, the
-p
flag should be set to8000:8000
for the back-end and3000:3000
for the front-end.Build/run the two together:
In the root directory run
docker-compose up
. This should start both containers and have them talk to each other. When you visithttp://localhost:3000/
, you may need to refresh the page once to get the Node list on the side. This bug was fixed in #76.