-
Notifications
You must be signed in to change notification settings - Fork 356
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
feat: add dockerfile 🐳 #76
Conversation
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.
Use ADD / VOLUME to get the website files from the folder into the container, also add a CMD line to start the container easily.
No worries I'm working on it |
Cool ! , I'd also suggest to have a dev command with nodemom so people can use the docker container while developing too. |
b01238a
to
5247630
Compare
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.
LGTM, merge if the image builds.
Notice I had to put the Dockerfile at the root of the repo, making it able to grab data.json for production release. As this project looks more and more like a piece of software than a list, we could maybe move all the content from |
@aslafy-z +1 on that |
@aslafy-z I think it's best if we create a new issue regarding moving all content from |
Do you guys feel good if the dev image does not include any other files that |
Noted! |
93cacab
to
d5d1c44
Compare
I just rebased all the commits. It needs a review, especially on the doc side as I'm still learning english 😉. @swapagarwal I'd be happy to add a step in the CI that builds the image, do you mind giving me (or the collaborator team, would love to be part of it though) some access to it? Thank you |
I still need to delete |
I added a |
@darshkpatel Could you please redo your review ? |
ae7427c
to
51af4a4
Compare
@aslafy-z I missed your comment somehow. 😇 @vikaspotluri123 You have helped a lot in shaping the website. Sent you an invite too! 😉 |
7b94a3b
to
bb11ec8
Compare
cdfe894
to
8a8ca5b
Compare
d9194cb
to
967d357
Compare
@aslafy-z You mixed port 8000 with port 8080, you need to normalize across the file. I was going to suggest changes, but there are lots of occurrances. |
@vikaspotluri123 I thought I changed it everywhere. Done now. If you have permissions issues, try to drop the |
I'm going to trust you on this. Docker on Windows makes mapping volumes to an existing file very difficult, and my linux vm is on a mechanical drive. |
I think I found it! I was able to reproduce using https://labs.play-with-docker.com/ # Change user to non-root
adduser -D devswag
chmod o+rw /var/run/docker.sock # ugly
su - devswag # That has to be another copy/paste
git clone https://github.com/aslafy-z/swag-for-dev -b add-dockerfile
cd swag-for-dev/
docker build -t devswag:dev --target base .
mkdir dist # CREATE DIST FOLDER
docker run -it --rm \
-v $(pwd)/data.json:/devswag/data.json \
-v $(pwd)/src:/devswag/src \
-v $(pwd)/gulpfile.js:/devswag/gulpfile.js \
-v $(pwd)/get-data.js:/devswag/get-data.js \
-v $(pwd)/dist:/devswag/dist \
-u $(id -u):$(id -g) \
-p 8080:8080 -p 35729:35729 devswag:dev |
I pulled the latest commit and |
Add a Dockerfile in order to ease website development with fixed dependencies and tooling.
Two variants:
devswag:dev
: development image, does not contain any code but all the tooling to work with itdevswag
: production image, uses nginx to serve the built artifactsMore infos: https://github.com/aslafy-z/swag-for-dev/blob/add-dockerfile/CONTRIBUTING.md#lets-start-hacking
I just pushed the two variants to my docker-hub if anyone wants to try them without downloading the code (can't use dev images as it needs to be plugged to the code using volumes): https://hub.docker.com/r/zadki3l/devswag/tags/
TODO