https://github.com/noherczeg/wrangler-docker-wrapper
Externalize Cloudflare Wrangler related sources and binaries
https://github.com/noherczeg/wrangler-docker-wrapper
Last synced: 2 months ago
JSON representation
Externalize Cloudflare Wrangler related sources and binaries
- Host: GitHub
- URL: https://github.com/noherczeg/wrangler-docker-wrapper
- Owner: noherczeg
- Created: 2020-01-30T20:16:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-22T11:32:22.000Z (almost 5 years ago)
- Last Synced: 2025-02-01T16:48:45.261Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wrangler Docker Wrapper
The [Wrangler CLI](https://developers.cloudflare.com/workers/tooling/wrangler/) comes with all kinds of dependencies like github.com connection, Rust, and related solutions which might not be necessary for static website projects.This image contains everything necessary to publish with `wrangler`, no additional steps will be involved.
## Deploy
Static web folder **MUST** be mapped to `/opt/project/public`.> You might want to use different `CF_APP_NAME` for _prod_ and _dev_ modes to prevent potential name collisions for your Workers
### Dev
Will deploy to _*.workers.dev_.```
docker run -it --rm \
-e CF_ACCOUNT_ID="YOUR_ACCOUNT_ID" \
-e CF_API_TOKEN="YOUR_API_TOKEN" \
-e CF_APP_NAME="NAME_OF_YOUR_APP" \
-v $(pwd)/project/public:/opt/project/public \
noherczeg/wrangler-docker-wrapper:1.1.2
```### Production
Specifying the _CF_ROUTE_ environment variable turns off workders.dev deployment.```
docker run -it --rm \
-e CF_ACCOUNT_ID="YOUR_ACCOUNT_ID" \
-e CF_API_TOKEN="YOUR_API_TOKEN" \
-e CF_APP_NAME="NAME_OF_YOUR_APP" \
-e CF_ZONE_ID="YOUR_ZONE_ID" \
-e CF_ROUTE="ROUTE_TO_WORKER" \
-v $(pwd)/project/public:/opt/project/public \
noherczeg/wrangler-docker-wrapper:1.1.0
```## Overriding Worker Script
This Container uses a default script ([./project/workers-site/index.js]()).You can override the script by mapping your own file when running the Container.
```
-v SOME_PATH/index.js:/opt/project/workers-site/index.js
```## Additional environment variables
- NPM_REGISTRY
- NPM_HTTP_PROXY
- NPM_HTTPS_PROXY> You are not expected to rely on these.
## Resources
#### Template Source
- https://github.com/cloudflare/worker-sites-template## LICENSE
MIT