Skip to content

Commit

Permalink
Merge pull request #36 from jasonraimondi/next
Browse files Browse the repository at this point in the history
v2.0.0
  • Loading branch information
jasonraimondi authored Mar 21, 2024
2 parents ae8bb28 + 23528cf commit d6b303b
Show file tree
Hide file tree
Showing 56 changed files with 5,288 additions and 2,838 deletions.
72 changes: 59 additions & 13 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,17 +1,63 @@
ALLOW_LIST=jasonraimondi.com,github.com
# Logging level (debug, info, warn, error)
LOG_LEVEL=debug

STORAGE_PROVIDER=
# Node environment (development, production)
NODE_ENV=development

COUCH_DB_PROTOCOL=
COUCH_DB_HOST=
COUCH_DB_PORT=
COUCH_DB_USER=
COUCH_DB_PASS=
# Port number for the application to listen on (optional)
#PORT=3089

AWS_ACCESS_KEY=
AWS_SECRET_KEY=
AWS_REGION=
AWS_BUCKET=
# Comma-separated list of allowed domains for screenshots (optional)
#ALLOW_LIST=jasonraimondi.com,github.com

BROWSER_TIMEOUT=10000
BROWSER_WAIT_UNTIL=domcontentloaded
# Cache-Control header value for the responses (optional)
#CACHE_CONTROL="public, max-age=86400, immutable"

# Browser timeout in milliseconds for rendering (optional)
#BROWSER_TIMEOUT=10000

# Event to wait for before considering the page loaded (optional)
#BROWSER_WAIT_UNTIL=domcontentloaded

# Idle timeout for database connection pool in milliseconds (optional)
#POOL_IDLE_TIMEOUT_MS=15000

# Maximum number of connections in the database pool (optional)
#POOL_MAX=10

# Maximum number of waiting clients for the database pool (optional)
#POOL_MAX_WAITING_CLIENTS=50

# Minimum number of connections in the database pool (optional)
#POOL_MIN=2

# Enable or disable metrics collection (optional)
#METRICS=false

# Encryption key for sensitive data (optional)
#CRYPTO_KEY=

# Storage provider (stub, s3, couchdb, filesystem)
STORAGE_PROVIDER=stub

# Configuration for filesystem storage provider (optional)
#STORAGE_PROVIDER=filesystem
#IMAGE_STORAGE_PATH=

# Configuration for S3 storage provider (optional)
#STORAGE_PROVIDER=s3
#AWS_BUCKET=
#AWS_ACCESS_KEY_ID=
#AWS_SECRET_ACCESS_KEY=
#AWS_DEFAULT_REGION=us-east-1
#AWS_ENDPOINT_URL_S3=
#AWS_FORCE_PATH_STYLE=false

# Configuration for CouchDB storage provider (optional)
#STORAGE_PROVIDER=couchdb
#COUCH_DB_HOST=
#COUCH_DB_PASS=
#COUCH_DB_PORT=
#COUCH_DB_PROTOCOL=
#COUCH_DB_USER=
#COUCHDB_DATABASE=images
30 changes: 30 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy VitePress site to GitHub Pages

on:
push:
branches:
- main
- next
paths:
- '.github/workflows/docs.yml'
- 'docs/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm docs:build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: Build and Publish Docker Image
name: Build and publish Docker images

on:
push:
branches:
- main
- next
tags:
- '*'

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v1
Expand All @@ -31,11 +32,12 @@ jobs:
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
echo "version=latest" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/next ]]; then
echo "version=nightly" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
- uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
Expand Down
3 changes: 3 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
node = "20"
pnpm = "8"
14 changes: 7 additions & 7 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"printWidth": 120,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all"
}
arrowParens: avoid
bracketSpacing: true
printWidth: 100
trailingComma: all
tabWidth: 2
semi: true
singleQuote: false
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,20 @@ RUN npm install -g pnpm \

FROM baserepo as builder
WORKDIR /
RUN apt-get update \
&& apt-get install -y wget
USER pwuser
WORKDIR /app
COPY package.json pnpm-lock.yaml /app
COPY package.json pnpm-lock.yaml /app/
RUN pnpm install --production false
COPY tsconfig.json /app/
COPY tsconfig.json tsconfig.build.json /app/
COPY src /app/src
RUN pnpm build


FROM baserepo
ENV DOCKER=1
RUN apt-get update \
&& apt-get install -y tini
USER pwuser
COPY --from=builder --chown=pwuser:pwuser /app/package.json /app/pnpm-lock.yaml /app/
RUN pnpm install --production
RUN pnpm install --production && pnpm exec playwright install chromium
COPY --from=builder --chown=pwuser:pwuser /app/dist /app/dist
EXPOSE 3000
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD node -r dotenv/config dist/main.js
CMD ["node", "-r", "dotenv/config", "dist/main.js"]
Loading

0 comments on commit d6b303b

Please sign in to comment.