modernWebDevGenerator icon indicating copy to clipboard operation
modernWebDevGenerator copied to clipboard

Why is the dist folder in the .dockerignore file?

Open ospaarmann opened this issue 9 years ago • 3 comments

I don't see the reason for having dist in the .dockerignore file. How I am using this is: Develop locally, run gulp to build everything production ready and then copy the output from the dist folder into a nginx Docker image. With this entry I of course get the error

lstat dist: no such file or directory

when building the image.

Example Dockerfile:

FROM nginx

ENV LANG en_US.UTF-8

# Copy configuration files
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf

# Add Gulp output folder to server root
ADD ./dist /usr/share/nginx/html

# Port configuration
EXPOSE 8080

It took me some time to realize that the folder was in there :)

ospaarmann avatar Mar 23 '16 14:03 ospaarmann

Honestly I don't remember, I did that quite a while ago. I still have an issue opened to look at the Docker support. I did this in an older project: https://github.com/dsebastien/midnightLightV2/blob/master/Dockerfile There you can see how I built my image, maybe it'll help?

dsebastien avatar Mar 23 '16 15:03 dsebastien

I think this is fine if you run this with nodejs. But it doesn't make sense if you use gulp to create a static build that you then serve with nginx or Apache. Which could be beneficial and more performant.

I suggest to at least put a note in the Readme.

ospaarmann avatar Mar 23 '16 15:03 ospaarmann

I agree. Don't hesitate to submit a PR for better Docker support. I think your approach is nice and could be beneficial to others :)

dsebastien avatar Mar 23 '16 15:03 dsebastien