Compare commits
2 Commits
81f7630678
...
615361ece3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
615361ece3 | ||
|
|
09ba89d2de |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,7 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
pgdata
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
/node_modules
|
||||||
/.pnp
|
/.pnp
|
||||||
|
|||||||
28
Dockerfile
28
Dockerfile
@ -0,0 +1,28 @@
|
|||||||
|
FROM node:22-slim AS base
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
|
# Stage 1: Install dependencies
|
||||||
|
FROM base AS deps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Stage 2: Build the application
|
||||||
|
FROM base AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
COPY . .
|
||||||
|
RUN pnpm run build
|
||||||
|
|
||||||
|
# Stage 3: Production server
|
||||||
|
FROM base AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
COPY --from=builder /app/public ./public
|
||||||
|
COPY --from=builder /app/.next/standalone ./
|
||||||
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["pnpm", "run", "server.js"]
|
||||||
@ -1,16 +1,45 @@
|
|||||||
---
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
web:
|
||||||
image: postgres:12.18
|
build: .
|
||||||
restart: always
|
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=postgres
|
- NODE_ENV=production
|
||||||
- POSTGRES_PASSWORD=admin
|
depends_on:
|
||||||
- POSTGRES_DB=website
|
- db
|
||||||
|
networks:
|
||||||
|
- my_network
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:latest
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
# ports:
|
||||||
|
# this exposes the database to the public ... do we want that??
|
||||||
|
# - "5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- ial-website-data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- my_network
|
||||||
|
|
||||||
|
cron:
|
||||||
|
image: alpine/curl
|
||||||
|
command: >
|
||||||
|
sh -c "
|
||||||
|
echo '*/10 * * * * curl -X POST http://web:3000/db/clear' > /etc/crontabs/root && \
|
||||||
|
crond -f -l 2
|
||||||
|
"
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
networks:
|
||||||
|
- my_network
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
ial-website-data:
|
postgres_data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
my_network:
|
||||||
|
name: my_network
|
||||||
|
driver: bridge
|
||||||
|
|||||||
@ -3,6 +3,8 @@ import {withPayload} from "@payloadcms/next/withPayload";
|
|||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
/* config options here */
|
||||||
|
output: "standalone",
|
||||||
|
compress: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPayload(nextConfig);
|
export default withPayload(nextConfig);
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbo",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "node .next/standalone/server.js",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"payload": "cross-env PAYLOAD_CONFIG_PATH=./payload.config.ts payload"
|
"payload": "cross-env PAYLOAD_CONFIG_PATH=./payload.config.ts payload"
|
||||||
},
|
},
|
||||||
@ -16,6 +16,7 @@
|
|||||||
"@payloadcms/next": "^3.35.1",
|
"@payloadcms/next": "^3.35.1",
|
||||||
"@payloadcms/richtext-lexical": "^3.35.1",
|
"@payloadcms/richtext-lexical": "^3.35.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"dayjs": "^1.11.13",
|
||||||
"graphql": "^16.10.0",
|
"graphql": "^16.10.0",
|
||||||
"motion": "^12.7.4",
|
"motion": "^12.7.4",
|
||||||
"next": "15.2.4",
|
"next": "15.2.4",
|
||||||
|
|||||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@ -23,6 +23,9 @@ importers:
|
|||||||
cross-env:
|
cross-env:
|
||||||
specifier: ^7.0.3
|
specifier: ^7.0.3
|
||||||
version: 7.0.3
|
version: 7.0.3
|
||||||
|
dayjs:
|
||||||
|
specifier: ^1.11.13
|
||||||
|
version: 1.11.13
|
||||||
graphql:
|
graphql:
|
||||||
specifier: ^16.10.0
|
specifier: ^16.10.0
|
||||||
version: 16.10.0
|
version: 16.10.0
|
||||||
@ -1309,6 +1312,9 @@ packages:
|
|||||||
dateformat@4.6.3:
|
dateformat@4.6.3:
|
||||||
resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
|
resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
|
||||||
|
|
||||||
|
dayjs@1.11.13:
|
||||||
|
resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==}
|
||||||
|
|
||||||
debug@4.4.0:
|
debug@4.4.0:
|
||||||
resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==}
|
resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==}
|
||||||
engines: {node: '>=6.0'}
|
engines: {node: '>=6.0'}
|
||||||
@ -3710,6 +3716,8 @@ snapshots:
|
|||||||
|
|
||||||
dateformat@4.6.3: {}
|
dateformat@4.6.3: {}
|
||||||
|
|
||||||
|
dayjs@1.11.13: {}
|
||||||
|
|
||||||
debug@4.4.0:
|
debug@4.4.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
ms: 2.1.3
|
ms: 2.1.3
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Button from "@/components/ui/button";
|
import Button from "~/components/ui/Button";
|
||||||
import prisma from "@/lib/prisma";
|
|
||||||
import { ChevronRightIcon } from "@heroicons/react/20/solid";
|
import { ChevronRightIcon } from "@heroicons/react/20/solid";
|
||||||
import dayjs from "dayjs";
|
// import dayjs from "dayjs";
|
||||||
|
|
||||||
export default function News() {
|
export default function News() {
|
||||||
return (
|
return (
|
||||||
@ -26,20 +26,20 @@ export default function News() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function Gallery() {
|
async function Gallery() {
|
||||||
const news = await prisma.news.findMany({
|
// const news = await prisma.news.findMany({
|
||||||
where: {
|
// where: {
|
||||||
draft: false,
|
// draft: false,
|
||||||
},
|
// },
|
||||||
orderBy: {
|
// orderBy: {
|
||||||
date: "desc",
|
// date: "desc",
|
||||||
},
|
// },
|
||||||
take: 3,
|
// take: 3,
|
||||||
});
|
// });
|
||||||
|
|
||||||
// TODO: parse markdown
|
// TODO: parse markdown
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col lg:grid lg:grid-cols-3 place-items-start gap-10 lg:gap-20">
|
<div className="flex flex-col lg:grid lg:grid-cols-3 place-items-start gap-10 lg:gap-20">
|
||||||
{news.map((item) => (
|
{/* {news.map((item) => (
|
||||||
<div key={item.id} className="space-y-2 lg:space-y-4">
|
<div key={item.id} className="space-y-2 lg:space-y-4">
|
||||||
<div className="text-sm text-accent-700">
|
<div className="text-sm text-accent-700">
|
||||||
{dayjs(item.date).format("DD/MM/YYYY")}
|
{dayjs(item.date).format("DD/MM/YYYY")}
|
||||||
@ -53,7 +53,7 @@ async function Gallery() {
|
|||||||
Read more <ChevronRightIcon className="h-5 w-5 ml-2" />
|
Read more <ChevronRightIcon className="h-5 w-5 ml-2" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))} */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"],
|
"@/*": ["./src/*"],
|
||||||
|
"~/*": ["./src/app/(frontend)/*"],
|
||||||
"@payload-config": ["./payload.config.ts"]
|
"@payload-config": ["./payload.config.ts"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user