| # Items that don't need to be in a Docker image | |||||
| # Anything not used by the build system should go here | |||||
| Dockerfile | |||||
| .dockerignore | |||||
| .gitignore | |||||
| README.md | |||||
| */.git/ | |||||
| # Artifacts that will be build during image creation. | |||||
| # This should contain all files created during `npm run build`. | |||||
| */node_modules/ | |||||
| */build/ |
| FROM node:16-alpine | |||||
| WORKDIR /app | |||||
| COPY package*.json ./ | |||||
| COPY src ./ | |||||
| COPY public ./ | |||||
| RUN yarn install | |||||
| # Bundle app source | |||||
| COPY . . | |||||
| EXPOSE 3000 | |||||
| CMD ["yarn", "start"] | |||||
| ######################################################## | |||||
| ################## BUILD VERSION ####################### | |||||
| # Use a Node 16 base image | |||||
| #FROM node:16-alpine | |||||
| # Set the working directory to /app inside the container | |||||
| #WORKDIR /app | |||||
| # Copy app files | |||||
| #COPY . . | |||||
| # ==== BUILD ===== | |||||
| # Install dependencies | |||||
| #RUN yarn | |||||
| # Build the app | |||||
| #RUN yarn run build | |||||
| # ==== RUN ======= | |||||
| # Set the env to "production" | |||||
| #ENV NODE_ENV production | |||||
| # Expose the port on which the app will be running (3000 is the default that `serve` uses) | |||||
| #EXPOSE 3000 | |||||
| # Start the app | |||||
| #CMD [ "npx", "serve", "build" ] |
| This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||||
| ## Available Scripts | ## Available Scripts | ||||
| ## Docker Scripts | |||||
| ### Create docker container | |||||
| ### `docker build -t diligent-react .` | |||||
| ### Start docker container | |||||
| ### `docker run --rm -p 3000:3000 --name template diligent-react` | |||||
| ### For more information see Dockerfile | |||||
| In the project directory, you can run: | In the project directory, you can run: | ||||
| ### `npm start` | ### `npm start` |
| const { t } = useTranslation(); | const { t } = useTranslation(); | ||||
| const error = useSelector(selectLoginError); | const error = useSelector(selectLoginError); | ||||
| console.log('error', error); | |||||
| const [showPassword, setShowPassword] = useState(false); | const [showPassword, setShowPassword] = useState(false); | ||||
| const handleClickShowPassword = () => setShowPassword(!showPassword); | const handleClickShowPassword = () => setShowPassword(!showPassword); | ||||
| const handleMouseDownPassword = () => setShowPassword(!showPassword); | const handleMouseDownPassword = () => setShowPassword(!showPassword); |