Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Why is the dist folder in the .dockerignore file? #96

Open
ospaarmann opened this issue Mar 23, 2016 · 3 comments
Open

Why is the dist folder in the .dockerignore file? #96

ospaarmann opened this issue Mar 23, 2016 · 3 comments

Comments

@ospaarmann
Copy link

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 :)

@dsebastien
Copy link
Owner

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?

@ospaarmann
Copy link
Author

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.

@dsebastien
Copy link
Owner

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants