Skip to content

Commit 2407f29

Browse files
alepounaNufflee
andauthored
Docker support (#1)
Co-authored-by: Nufflee <[email protected]>
1 parent 8a9521d commit 2407f29

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
npm-debug.log
3+
wrangler.toml

Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:20
2+
# Create app directory
3+
WORKDIR /usr/src/app
4+
# Install app dependencies
5+
COPY package*.json ./
6+
RUN npm install
7+
# Bundle app source
8+
COPY . .
9+
EXPOSE 6969
10+
CMD [ "npm", "run", "start-local" ]

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Currently hosted on `nuff.gay`. To use it, simply take an avherald.com URL and r
88

99
## Running locally
1010

11-
Run:
11+
### With NPM
1212

1313
```
1414
$ npm i
@@ -18,6 +18,21 @@ $ npm run start-local
1818
> [!NOTE]
1919
> To test embeds on Discord or similar services, you need to expose your instance to the Internet. The simplest way to do that is by using a tunnel, such as [localtunnel](https://theboroer.github.io/localtunnel-www/).
2020
21+
### With Docker
22+
23+
```
24+
$ npm run docker:build
25+
$ npm run docker:run
26+
```
27+
28+
### With Docker Compose
29+
30+
```
31+
$ npm run docker:compose
32+
```
33+
34+
You can find the details of the docker-compose setup in `docker-compose.yml`.
35+
2136
## Deploying on Cloudflare
2237

2338
First, follow the [Cloudflare Getting Started guide](https://developers.cloudflare.com/workers/get-started/guide/) and create a new worker with the name `embedherald` (or one of your choosing, in which case you'll need to modify `wrangler.toml`).

docker-compose.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3.7'
2+
services:
3+
embedherlad:
4+
image: nufflee/embedherald:latest
5+
ports:
6+
- 6969:6969

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"main": "src/worker.ts",
66
"scripts": {
77
"start-local": "npx ts-node src/local.ts --transpileOnly",
8-
"deploy": "npx wrangler deploy src/worker.ts"
8+
"deploy": "npx wrangler deploy src/worker.ts",
9+
"docker:build": "docker build . -t nufflee/embedherald",
10+
"docker:run": "docker run -p 6969:6969 nufflee/embedherald"
911
},
1012
"repository": {
1113
"type": "git",

0 commit comments

Comments
 (0)