Skip to content

Commit

Permalink
Added dockerfile with frontend builded
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubervila committed Oct 31, 2024
1 parent b2f4615 commit 89fe712
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
12 changes: 7 additions & 5 deletions compose/production/react/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
FROM node:22.7.0-bookworm-slim AS base
FROM node:22.11.0-bookworm-slim AS base

ENV GENERATE_SOURCEMAP=false
ENV NODE_OPTIONS=--max_old_space_size=8192

COPY ./compose/local/react/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start
# COPY ./compose/production/react/start /start
# RUN sed -i 's/\r$//g' /start
# RUN chmod +x /start

RUN mkdir /app && chown -R node:node /app

COPY ./frontend /app
WORKDIR /app

USER node
# USER node

RUN yarn -v
RUN yarn --non-interactive --ignore-optional --network-timeout 500000
RUN yarn run build
CMD ["yarn", "start"]
15 changes: 12 additions & 3 deletions frontend/app/page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
'use client';
import Box from '@mui/material/Box';
import Aladin from "@/components/Aladin";

// import Aladin from "@/components/Aladin";
import { useState, useEffect } from 'react'
import dynamic from 'next/dynamic'
const Aladin = dynamic(() => import('@/components/Aladin'), { ssr: false })

export default function Home() {
const [isClient, setIsClient] = useState(false)

useEffect(() => {
setIsClient(true)
}, [])

return (
// tamanho minimo do container principal deve ser
// Total disponivel 100vg - 64px do header ( O footer deve ficar abaixo do aladin acessado pelo scroll )
Expand All @@ -12,7 +20,8 @@ export default function Home() {
minHeight: 'calc(100vh - 64px)'
}}>
{/* SE tiver mais componentes tipo menu de escolha dos releases vai ficar aqui.*/}
{typeof window === "undefined" ? (<div>loading...</div>) : (<Aladin />)}
{/* {typeof window !== "undefined" && (<Aladin />)} */}
{isClient ? <Aladin /> : 'Loading'}
</Box>
);
}

0 comments on commit 89fe712

Please sign in to comment.