Skip to content

Commit

Permalink
feat(docker): add Dockerfile and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
wei committed Nov 17, 2024
1 parent 3990f7d commit bd83861
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
coverage
npm-debug.log
*.pem
.env
.*
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ARG DENO_VERSION=2.0.6
FROM denoland/deno:alpine-${DENO_VERSION}

LABEL \
org.opencontainers.image.title="pull" \
org.opencontainers.image.description="Keep your forks up-to-date via automated PRs" \
org.opencontainers.image.url="https://github.com/wei/pull" \
org.opencontainers.image.documentation="https://github.com/wei/pull#readme" \
org.opencontainers.image.source="https://github.com/wei/pull" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.authors="Wei He <[email protected]>" \
maintainer="Wei He <[email protected]>"

ENV \
####################
### Required ###
####################
APP_ID= \
APP_NAME= \
WEBHOOK_SECRET= \
PRIVATE_KEY= \
####################
### Optional ###
####################
#SENTRY_DSN= \
#GHE_HOST= \
PORT=3000 \
LOG_FORMAT=short \
LOG_LEVEL=info \
WEBHOOK_PATH=/api/github/webhooks \
CONFIG_FILENAME=pull.yml \
DEFAULT_MERGE_METHOD=hardreset \
_=

# Set working directory
WORKDIR /app

# Copy dependency files
# COPY deno.jsonc .
# COPY import_map.json* .

# Copy source code
COPY . .

# The app uses port 3000 by default
EXPOSE 3000

# Command to run the app
# CMD ["deno", "task", "dev"]
# CMD ["deno", "task", "worker"]
50 changes: 50 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
services:
app:
build: .
restart: unless-stopped
ports:
- "3000:3000"
env_file:
- ./.env
depends_on:
- mongodb
- redis
# volumes:
# - .:/app
command: deno task dev

worker:
build: .
restart: unless-stopped
env_file:
- ./.env
depends_on:
- mongodb
- redis
- app
# volumes:
# - .:/app
command: deno task worker

mongodb:
image: mongo:8
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: mongodb_password
volumes:
- mongodb-data:/data/db
# ports:
# - "27017:27017"

redis:
image: redis:7.4
restart: unless-stopped
volumes:
- redis-data:/data
# ports:
# - "6379:6379"

volumes:
mongodb-data:
redis-data:

0 comments on commit bd83861

Please sign in to comment.