Skip to content

Commit

Permalink
all: refactor go module
Browse files Browse the repository at this point in the history
  • Loading branch information
zeim839 committed Dec 22, 2023
1 parent 303bcc9 commit bf9a0b7
Show file tree
Hide file tree
Showing 22 changed files with 1,329 additions and 112 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build-oauth2:
docker build --tag oauth2 -f oauth2/Dockerfile .

build-websmtp:
docker build --tag websmtp -f websmtp/Dockerfile .

build-dashboard:
docker build --tag dashboard -f dashboard/Dockerfile .
6 changes: 5 additions & 1 deletion dashboard/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "next/core-web-vitals"
"extends": "next",
"rules": {
"react-hooks/rules-of-hooks": "off",
"react/no-unescaped-entities": "off"
}
}
33 changes: 33 additions & 0 deletions dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:18-alpine AS base

FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /dashboard

COPY dashboard/package.json dashboard/package-lock.json* ./
RUN npm ci

FROM base AS builder
WORKDIR /dashboard
COPY --from=deps /dashboard/node_modules ./node_modules
COPY dashboard .
RUN npm run build

FROM base AS runner
WORKDIR /dashboard
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /dashboard/public ./public
RUN mkdir .next
RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /dashboard/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /dashboard/.next/static ./.next/static

USER nextjs
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"

CMD ["node", "server.js"]
41 changes: 1 addition & 40 deletions dashboard/next.config.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async rewrites() {
return [
{
source: '/auth/signup',
destination: 'http://localhost:8080/auth/signup',
},
{
source: '/auth/signin',
destination: 'http://localhost:8080/auth/signin',
},
{
source: '/auth/signout',
destination: 'http://localhost:8080/auth/signout',
},
{
source: '/auth/verify',
destination: 'http://localhost:8080/auth/verify',
},
{
source: '/auth/authorize',
destination: 'http://localhost:8080/auth/authorize',
},
{
source: '/auth/token',
destination: 'http://localhost:8080/auth/token',
},
{
source: '/client/:id',
destination: 'http://localhost:8080/client/:id',
},
{
source: '/client',
destination: 'http://localhost:8080/client',
},
{
source: '/user',
destination: 'http://localhost:8080/user',
},
]
},
"output": 'standalone',
}
Loading

0 comments on commit bf9a0b7

Please sign in to comment.