Skip to content

Commit 2e379d9

Browse files
committed
added compose for fe and nexus
1 parent 9a95fb3 commit 2e379d9

5 files changed

Lines changed: 80 additions & 6 deletions

File tree

frontend/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM oven/bun:1 AS deps
2+
WORKDIR /app
3+
4+
# Copy package files
5+
COPY package.json bun.lockb* ./
6+
RUN bun install --frozen-lockfile
7+
8+
FROM node:20-alpine AS builder
9+
WORKDIR /app
10+
11+
COPY --from=deps /app/node_modules ./node_modules
12+
COPY . .
13+
14+
RUN npm run build
15+
16+
FROM oven/bun:1-alpine AS runner
17+
WORKDIR /app
18+
19+
# Create non-root user
20+
RUN addgroup --system --gid 1001 nodejs && \
21+
adduser --system --uid 1001 nextjs
22+
23+
COPY --from=builder /app/public ./public
24+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
25+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
26+
27+
USER nextjs
28+
29+
EXPOSE 3000
30+
31+
CMD ["bun", "run", "server.js"]

frontend/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.8'
2+
services:
3+
nextjs:
4+
build: .
5+
ports:
6+
- "3000:3000"
7+
environment:
8+
- NODE_ENV=production

frontend/next.config.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
21
/** @type {import('next').NextConfig} */
32
const nextConfig = {
4-
5-
3+
output: "standalone",
64
};
75

8-
9-
10-
export default nextConfig
6+
export default nextConfig;

nexus/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM oven/bun:1 AS deps
2+
WORKDIR /app
3+
4+
# Copy package files
5+
COPY package.json bun.lockb* ./
6+
RUN bun install --frozen-lockfile
7+
8+
FROM node:20-alpine AS builder
9+
WORKDIR /app
10+
11+
COPY --from=deps /app/node_modules ./node_modules
12+
COPY . .
13+
14+
RUN npm run build
15+
16+
FROM oven/bun:1-alpine AS runner
17+
WORKDIR /app
18+
19+
# Create non-root user
20+
RUN addgroup --system --gid 1001 nodejs && \
21+
adduser --system --uid 1001 nextjs
22+
23+
COPY --from=builder /app/public ./public
24+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
25+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
26+
27+
USER nextjs
28+
29+
EXPOSE 3000
30+
31+
CMD ["bun", "run", "server.js"]

nexus/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.8'
2+
services:
3+
nextjs:
4+
build: .
5+
ports:
6+
- "3000:3000"
7+
environment:
8+
- NODE_ENV=production

0 commit comments

Comments
 (0)