Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladimirlogachev/elm-land-docker-example
Assets caching, Docker setup, app configured at runtime
https://github.com/vladimirlogachev/elm-land-docker-example
api-rest assets docker elm elm-land elm-lang spa
Last synced: 27 days ago
JSON representation
Assets caching, Docker setup, app configured at runtime
- Host: GitHub
- URL: https://github.com/vladimirlogachev/elm-land-docker-example
- Owner: vladimirlogachev
- Created: 2024-01-07T16:53:01.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-13T19:40:54.000Z (7 months ago)
- Last Synced: 2024-04-14T09:54:24.022Z (7 months ago)
- Topics: api-rest, assets, docker, elm, elm-land, elm-lang, spa
- Language: Elm
- Homepage:
- Size: 973 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ccamel - vladimirlogachev/elm-land-docker-example - Assets caching, Docker setup, app configured at runtime (Elm)
README
# Elm Land Docker Example
#
## Features
- Assets caching (set up in container too)
- Docker build (can be deployed in private environment)
- Application is configured at runtime via environment variables:
- Application config
- Whether or not to allow indexing (`robots.txt`)
- Deployment can be done without accessing the source code (Docker image doesn't contain any sources, and customer can parametrize the app via environment variables and deploy wherever they want)## Prerequisites
- NPM
- Docker## Local development (without Docker)
- Install dependencies and start dev server
```sh
npm i
npm start
```- Open http://localhost:1234
## Docker
- Build and run Docker container
```sh
docker build -t elm-land-docker-example . &&
docker container run \
-p 1234:80 \
-e WEBAPP_ALLOW_INDEXING="true" \
-e WEBAPP_BACKEND_URL="https://en.wikipedia.org/api" \
elm-land-docker-example
```- Open http://localhost:1234
## How to add new env variables:
- `public/nocache/config.json` (and set default value for local development)
- `configs/nginx.on-startup.sh` (see the end of file)
- `src/Shared/Config.elm` (decode and use new values in your Elm app)