Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# dependencies
/node_modules
/server/node_modules
/.pnp
.pnp.js
/.direnv
Expand Down
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.9.2.cjs

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
yarnPath: .yarn/releases/yarn-3.6.1.cjs
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.9.2.cjs
21 changes: 15 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
#syntax=docker/dockerfile:1

FROM node:20-bookworm-slim AS base
RUN apt-get update -y && apt-get install -y ca-certificates git openssl
FROM node:20-alpine AS base
RUN apk update && apk add ca-certificates git openssl

FROM base AS build
RUN apt-get update -y && apt-get install -y build-essential python3
RUN apk update && apk add alpine-sdk python3
WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
COPY server/package.json ./server/package.json
COPY lib/db/schema.prisma ./lib/db/schema.prisma
COPY ./.yarn/ .yarn/
RUN --mount=type=cache,id=internal-site-yarn,target=.yarn/cache \
yarn install --immutable --inline-builds

COPY . /app/
RUN --mount=type=cache,id=internal-site-yarn,target=.yarn/cache yarn install --immutable --inline-builds

ENV NODE_ENV=production
ARG GIT_REV
ENV GIT_REV=$GIT_REV
ARG VERSION
ENV VERSION=$VERSION
RUN --mount=type=secret,id=sentry-auth-token \
RUN --mount=type=cache,target=/app/.next/cache \
--mount=type=secret,id=sentry-auth-token \
SENTRY_AUTH_TOKEN=$(cat /run/secrets/sentry-auth-token) \
SKIP_ENV_VALIDATION=1 \
PUBLIC_URL="http://localhost:3000" \
yarn run build

FROM build AS sentry_modules
RUN yarn workspaces focus server --production

FROM base
COPY --from=build /app/dist /app/dist
COPY --from=build /app/node_modules /app/node_modules
COPY --from=sentry_modules /app/node_modules /app/node_modules
COPY --from=build /app/.next/standalone /app
COPY --from=build /app/public /app/public
COPY --from=build /app/.next/static /app/.next/static
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
"name": "hypothetical-new-internal-site",
"version": "0.1.0",
"private": true,
"workspaces": [
"server"
],
"scripts": {
"dev": "nodemon",
"devSSL": "DEV_SSL=true nodemon",
"build": "next build && yarn build:server",
"build:server": "tsc -p tsconfig.server.json && tsc-alias -p tsconfig.server.json",
"build": "yarn build:client && yarn build:server",
"build:client": "next build",
"build:server": "yarn build:server:compile && yarn build:server:bundle",
"build:server:compile": "tsc -p tsconfig.server.json",
"build:server:bundle": "ncc build build/server/index.js -o dist/server -e next -e @prisma/client",
"start": "NODE_ENV=production node dist/server/index.js",
"lint": "next lint",
"test": "lint-staged",
Expand Down Expand Up @@ -104,6 +110,7 @@
"@types/ws": "^8.5.9",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^8.38.0",
"@vercel/ncc": "^0.38.3",
"dotenv-cli": "^7.2.1",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.32.0",
Expand All @@ -128,7 +135,7 @@
"tsx": "^4.16.2",
"zod-prisma": "^0.5.4"
},
"packageManager": "yarn@3.6.1",
"packageManager": "yarn@4.9.2",
"resolutions": {
"@fullcalendar/daygrid@^6.1.8": "patch:@fullcalendar/daygrid@npm%3A6.1.8#./.yarn/patches/@fullcalendar-daygrid-npm-6.1.8-3f45184389.patch",
"@fullcalendar/daygrid@~6.1.8": "patch:@fullcalendar/daygrid@npm%3A6.1.8#./.yarn/patches/@fullcalendar-daygrid-npm-6.1.8-3f45184389.patch"
Expand Down
7 changes: 4 additions & 3 deletions server/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { App } from "@slack/bolt";
import { type App } from "@slack/bolt";
import next from "next";
import { Server } from "socket.io";

import { authenticateSocket } from "./auth";
import { checkDatabaseConnection, prepareHttpServer } from "./lib";
import { env, validateEnv } from "../lib/env.js";
import { setupActionHandlers } from "../lib/slack/actions";
import {
createSlackApp,
isSlackEnabled,
} from "../lib/slack/slackApiConnection";
import { authenticateSocket } from "./auth";
import { checkDatabaseConnection, prepareHttpServer } from "./lib";

const dev = env.NODE_ENV !== "production";
const doSSL = env.DEV_SSL === "true";
Expand Down
11 changes: 11 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "server",
"private": true,
"version": "0.0.0",
"license": "UNLICENSED",
"dependencies": {
"@prisma/client": "*",
"@sentry/nextjs": "*",
"next": "*"
}
}
2 changes: 1 addition & 1 deletion tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"outDir": "build",
"target": "es2017",
"isolatedModules": false,
"noEmit": false,
Expand Down
Loading