Skip to content

Commit bd83861

Browse files
committed
feat(docker): add Dockerfile and docker compose
1 parent 3990f7d commit bd83861

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
coverage
3+
npm-debug.log
4+
*.pem
5+
.env
6+
.*

Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ARG DENO_VERSION=2.0.6
2+
FROM denoland/deno:alpine-${DENO_VERSION}
3+
4+
LABEL \
5+
org.opencontainers.image.title="pull" \
6+
org.opencontainers.image.description="Keep your forks up-to-date via automated PRs" \
7+
org.opencontainers.image.url="https://github.com/wei/pull" \
8+
org.opencontainers.image.documentation="https://github.com/wei/pull#readme" \
9+
org.opencontainers.image.source="https://github.com/wei/pull" \
10+
org.opencontainers.image.licenses="MIT" \
11+
org.opencontainers.image.authors="Wei He <[email protected]>" \
12+
maintainer="Wei He <[email protected]>"
13+
14+
ENV \
15+
####################
16+
### Required ###
17+
####################
18+
APP_ID= \
19+
APP_NAME= \
20+
WEBHOOK_SECRET= \
21+
PRIVATE_KEY= \
22+
####################
23+
### Optional ###
24+
####################
25+
#SENTRY_DSN= \
26+
#GHE_HOST= \
27+
PORT=3000 \
28+
LOG_FORMAT=short \
29+
LOG_LEVEL=info \
30+
WEBHOOK_PATH=/api/github/webhooks \
31+
CONFIG_FILENAME=pull.yml \
32+
DEFAULT_MERGE_METHOD=hardreset \
33+
_=
34+
35+
# Set working directory
36+
WORKDIR /app
37+
38+
# Copy dependency files
39+
# COPY deno.jsonc .
40+
# COPY import_map.json* .
41+
42+
# Copy source code
43+
COPY . .
44+
45+
# The app uses port 3000 by default
46+
EXPOSE 3000
47+
48+
# Command to run the app
49+
# CMD ["deno", "task", "dev"]
50+
# CMD ["deno", "task", "worker"]

docker-compose.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
services:
2+
app:
3+
build: .
4+
restart: unless-stopped
5+
ports:
6+
- "3000:3000"
7+
env_file:
8+
- ./.env
9+
depends_on:
10+
- mongodb
11+
- redis
12+
# volumes:
13+
# - .:/app
14+
command: deno task dev
15+
16+
worker:
17+
build: .
18+
restart: unless-stopped
19+
env_file:
20+
- ./.env
21+
depends_on:
22+
- mongodb
23+
- redis
24+
- app
25+
# volumes:
26+
# - .:/app
27+
command: deno task worker
28+
29+
mongodb:
30+
image: mongo:8
31+
restart: unless-stopped
32+
environment:
33+
MONGO_INITDB_ROOT_USERNAME: root
34+
MONGO_INITDB_ROOT_PASSWORD: mongodb_password
35+
volumes:
36+
- mongodb-data:/data/db
37+
# ports:
38+
# - "27017:27017"
39+
40+
redis:
41+
image: redis:7.4
42+
restart: unless-stopped
43+
volumes:
44+
- redis-data:/data
45+
# ports:
46+
# - "6379:6379"
47+
48+
volumes:
49+
mongodb-data:
50+
redis-data:

0 commit comments

Comments
 (0)