Merge branch 'feature/dockerize' into 'main'

Correct Dockerfile for Project

Closes #5

See merge request neshura-websites/www!4
This commit is contained in:
Neshura 2022-12-09 22:33:46 +00:00
commit 7e1b28b3f6
3 changed files with 5 additions and 10 deletions

View file

@ -30,18 +30,13 @@ WORKDIR /usr/src/app
ENV NODE_ENV production ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/node_modules ./node_modules
# Automatically leverage output traces to reduce image size # Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing # https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static COPY --from=builder /app/.next/static ./.next/static
USER nextjs
# expose port 3000 # expose port 3000
ENV PORT 3000 ENV PORT 3000

View file

@ -55,7 +55,7 @@ function Servers(props: LinkList) {
} }
export async function getServerSideProps() { export async function getServerSideProps() {
const filePath = path.join(process.cwd(), '/confs/pages.json') const filePath = path.join(process.cwd(), '/public/pages.json')
const jsonData = await fsPromises.readFile(filePath) const jsonData = await fsPromises.readFile(filePath)
const list = JSON.parse(jsonData.toString()) const list = JSON.parse(jsonData.toString())

View file

@ -40,9 +40,9 @@ function Services(props: LinkList) {
) )
} }
// Gets a List of all services specified in /confs/pages.json // Gets a List of all services specified in /public/pages.json
export async function getServerSideProps() { export async function getServerSideProps() {
const filePath = path.join(process.cwd(), './confs/pages.json') const filePath = path.join(process.cwd(), '/public/pages.json')
// TODO: look into asyncing this API call // TODO: look into asyncing this API call
const jsonData = await fsPromises.readFile(filePath) const jsonData = await fsPromises.readFile(filePath)
const list = JSON.parse(jsonData.toString()) const list = JSON.parse(jsonData.toString())