mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 09:21:25 +00:00
working docker build
This commit is contained in:
parent
e1cd6ddfdc
commit
005ff775e9
8
client/.dockerignore
Normal file
8
client/.dockerignore
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
README.md
|
||||||
|
.next
|
||||||
|
.git
|
||||||
|
build
|
1
client/.gitignore
vendored
1
client/.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
# 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.
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
/node_modules
|
||||||
|
21
client/Dockerfile
Normal file
21
client/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Stage 1: Building the React application
|
||||||
|
FROM node:18-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
||||||
|
RUN \
|
||||||
|
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||||
|
elif [ -f package-lock.json ]; then npm ci; \
|
||||||
|
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
|
||||||
|
else echo "Lockfile not found." && exit 1; \
|
||||||
|
fi
|
||||||
|
COPY . .
|
||||||
|
RUN yarn build # or `npm run build` if using npm
|
||||||
|
|
||||||
|
# Stage 2: Setting up Nginx to serve the React application
|
||||||
|
FROM nginx:alpine AS production
|
||||||
|
# Copy built assets from 'build' stage
|
||||||
|
COPY --from=build /app/build /usr/share/nginx/html
|
||||||
|
# Optional: If you have a custom nginx.conf, you can copy it to the container
|
||||||
|
# COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
@ -1,27 +1,48 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"lib": [
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext",
|
|
||||||
"webworker"
|
|
||||||
],
|
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"jsx": "preserve",
|
||||||
"jsx": "react-jsx"
|
"incremental": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||||
"src"
|
"exclude": ["node_modules"]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// {
|
||||||
|
// "compilerOptions": {
|
||||||
|
// "target": "es5",
|
||||||
|
// "lib": [
|
||||||
|
// "dom",
|
||||||
|
// "dom.iterable",
|
||||||
|
// "esnext",
|
||||||
|
// "webworker"
|
||||||
|
// ],
|
||||||
|
// "allowJs": true,
|
||||||
|
// "skipLibCheck": true,
|
||||||
|
// "esModuleInterop": true,
|
||||||
|
// "allowSyntheticDefaultImports": true,
|
||||||
|
// "strict": true,
|
||||||
|
// "forceConsistentCasingInFileNames": true,
|
||||||
|
// "noFallthroughCasesInSwitch": true,
|
||||||
|
// "module": "esnext",
|
||||||
|
// "moduleResolution": "node",
|
||||||
|
// "resolveJsonModule": true,
|
||||||
|
// "isolatedModules": true,
|
||||||
|
// "noEmit": true,
|
||||||
|
// "jsx": "react-jsx"
|
||||||
|
// },
|
||||||
|
// "include": [
|
||||||
|
// "src"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
Loading…
Reference in New Issue
Block a user