create-elm-app
create-elm-app copied to clipboard
Update the documentation
This issue is tracking the documentation that has to be updated.
- [ ] Document new platform commands
- [ ] Update the section dedicated to page
<title>and tell about Browser.document - [x] Update Interop JS example
- [ ] Check if docs about elm-css are still relevant.
- [ ] Update JS example in images and fonts
- [ ] Update JS example here
- [ ] Update the test script docs, and check if dependency sync is still relevant.
- [x] Replace mentions of
elm-package.jsonwithelm.json
Hi, not sure if this is the best place, but I just set up yet another create-elm-app project (and loving it) and thought you might like to add a minimal Docker setup to the docks. I can make a PR if you are interested. It's basically this:
FROM node:10-slim as dev
WORKDIR /app
RUN npm config set unsafe-perm true
RUN npm install -g create-elm-app
COPY . /app
CMD bash -c "rm -rf elm-stuff/ && elm-app start"
version: "3.4"
services:
web:
build:
context: .
target: dev
volumes:
- ".:/app:cached"
ports:
- 3000:3000
Might help someone.
Hello Tomke!
Thanks for the suggestion, it sounds like a good idea and I think it deserves a separate issue.
I'm afraid I can not advise using elm-app start for serving it because this is not intended for production.
I'd recommend using a static server inside a separate stage, which does not have create-elm-app installed.
I haven't tested this, but it would be the approach I would look into:
FROM node:10-slim as builder
WORKDIR /app
RUN npm config set unsafe-perm true && \
npm install -g create-elm-app
COPY . /app
RUN elm-app build
FROM node:10-slim
# Install the static file server
RUN npm install -g serve
# Copy the build artifacts
COPY --from=builder /app/build /app
CMD serve -s app
This would give us a slightly smaller image for production use. Please let me know what you think!
A PR would be very welcome!
@MrMovl
I'm afraid I can not advise using elm-app start for serving it because this is not intended for production
Oh god no, you are right of course. That is just a local dev setup. For a production docker build we use another container and use elm-app build for that. Similar to your version.
I'll make a PR when I got the time (hopefully soon). Thanks for the Input!
Also you shouldn't use sudo to install package globally, setting the global prefix to a folder in your $HOME in your npm config will do the trick.