diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..802c003f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,35 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + groups: + dev-patch-updates: + dependency-type: "development" + update-types: + - "patch" + dev-minor-updates: + dependency-type: "development" + update-types: + - "minor" + prod-patch-updates: + dependency-type: "production" + update-types: + - "patch" + prod-minor-updates: + dependency-type: "production" + update-types: + - "minor" + + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "daily" + groups: + patch-updates: + update-types: + - "patch" + minor-updates: + update-types: + - "minor" diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 00000000..750f9ecc --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,34 @@ +name: ESLint + +on: + pull_request: + paths: + - '**/*.js' + - '**/*.jsx' + - '**/*.ts' + - '**/*.tsx' + - '.eslintrc*' + - 'package.json' + - 'yarn.lock' + - 'pnpm-lock.yaml' + - 'package-lock.json' + +jobs: + Linter: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: | + npm ci + + - name: Run ESLint + run: | + npx eslint . --ext .js,.jsx,.ts,.tsx \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6ec9e23d..adfe2597 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,11 @@ RUN npm install COPY . . -RUN npx drizzle-kit generate --dialect sqlite --schema ./server/db/schemas/ --out init +RUN echo 'export * from "./sqlite";' > server/db/index.ts -RUN npm run build +RUN npx drizzle-kit generate --dialect sqlite --schema ./server/db/sqlite/schema.ts --out init + +RUN npm run build:sqlite FROM node:20-alpine AS runner @@ -32,4 +34,4 @@ COPY server/db/names.json ./dist/names.json COPY public ./public -CMD ["npm", "start"] +CMD ["npm", "run", "start:sqlite"] diff --git a/Dockerfile.pg b/Dockerfile.pg new file mode 100644 index 00000000..58c54d8c --- /dev/null +++ b/Dockerfile.pg @@ -0,0 +1,37 @@ +FROM node:20-alpine AS builder + +WORKDIR /app + +# COPY package.json package-lock.json ./ +COPY package.json ./ +RUN npm install + +COPY . . + +RUN echo 'export * from "./pg";' > server/db/index.ts + +RUN npx drizzle-kit generate --dialect postgresql --schema ./server/db/pg/schema.ts --out init + +RUN npm run build:pg + +FROM node:20-alpine AS runner + +WORKDIR /app + +# Curl used for the health checks +RUN apk add --no-cache curl + +# COPY package.json package-lock.json ./ +COPY package.json ./ +RUN npm install --only=production && npm cache clean --force + +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/init ./dist/init + +COPY server/db/names.json ./dist/names.json + +COPY public ./public + +CMD ["npm", "run", "start:pg"] diff --git a/Makefile b/Makefile index 793a3481..fdf5daa1 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ build-release: fi docker buildx build --platform linux/arm64,linux/amd64 -t fosrl/pangolin:latest -f Dockerfile --push . docker buildx build --platform linux/arm64,linux/amd64 -t fosrl/pangolin:$(tag) -f Dockerfile --push . + docker buildx build --platform linux/arm64,linux/amd64 -t fosrl/pangolin:postgresql-latest -f Dockerfile.pg --push . + docker buildx build --platform linux/arm64,linux/amd64 -t fosrl/pangolin:postgresql-$(tag) -f Dockerfile.pg --push . build-arm: docker buildx build --platform linux/arm64 -t fosrl/pangolin:latest . diff --git a/README.md b/README.md index 15ca7add..8723542c 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@

+ + No containers found matching the current + filters. +
++ No containers found. Make sure Docker containers + are running. +
+ )} +