Skip to content

Commit

Permalink
build: config files
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Aug 25, 2024
1 parent 381319c commit 9689ab6
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ Dockerfile*
.gitignore

# docs
README.md
README.md

# data
/data
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
# Example:
# SERVERVAR="foo"
# NEXT_PUBLIC_CLIENTVAR="bar"
NODE_ENV="development"
DATABASE_HOST="localhost"
DATABASE_PORT="5432"
DATABASE_USER="user"
DATABASE_PASSWORD="password"
DATABASE_NAME="database"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ next-env.d.ts

# site map
public/sitemap.xml
public/robots.txt
public/robots.txt

# data
/data
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install --production
RUN bun install --production --frozen-lockfile

COPY . .

Expand All @@ -13,4 +13,4 @@ RUN bun run build

EXPOSE 3000

ENTRYPOINT [ "bun", "run", "start" ]
ENTRYPOINT [ "bun", "run", "start" ]
Binary file modified bun.lockb
Binary file not shown.
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
app:
depends_on:
- db
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
db:
image: postgres:15
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- ./data/db:/var/lib/postgresql/data
ports:
- "5432:5432"
# s3:
# image: bitnami/minio:2024
# environment:
# MINIO_ROOT_USER: ${STORAGE_USER}
# MINIO_ROOT_PASSWORD: ${STORAGE_PASSWORD}
# MINIO_DEFAULT_BUCKETS: ${STORAGE_NAME}
# volumes:
# - ./data/s3:/bitnami/minio/data
# ports:
# - "9000:9000"
13 changes: 13 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'drizzle-kit';

import { env } from '@/env';

const connectionString = `postgresql://${env.DATABASE_USER}:${env.DATABASE_PASSWORD}@${env.DATABASE_HOST}:${env.DATABASE_PORT}/${env.DATABASE_NAME}`;

export default defineConfig({
schema: './src/server/db/schema/*.ts',
dialect: 'postgresql',
dbCredentials: {
url: connectionString,
},
});
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
"build": "next build",
"dev": "next dev --turbo",
"lint": "biome check --write --unsafe",
"start": "next start"
"start": "next start",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio"
},
"dependencies": {
"@libsql/client": "^0.6.2",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
Expand All @@ -28,13 +31,14 @@
"autoprefixer": "^10.4.19",
"country-flag-icons": "^1.5.12",
"cva": "^1.0.0-beta.1",
"drizzle-orm": "^0.31.2",
"drizzle-orm": "^0.33.0",
"lucide-react": "^0.396.0",
"next": "^14.2.4",
"next-intl": "^3.15.2",
"next-sitemap": "^4.2.3",
"next-themes": "^0.3.0",
"nuqs": "^1.17.4",
"postgres": "^3.4.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"reading-time": "^1.5.0",
Expand All @@ -48,7 +52,7 @@
"@types/node": "^20.14.8",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"drizzle-kit": "^0.22.7",
"drizzle-kit": "^0.24.1",
"lefthook": "^1.7.14",
"postcss": "^8.4.38",
"tailwind-scrollbar": "^3.1.0",
Expand Down

0 comments on commit 9689ab6

Please sign in to comment.