Browse Source

Added Dockerfile

master
Lazar Kostic 3 years ago
parent
commit
d71c8e7d65
4 changed files with 42 additions and 0 deletions
  1. 12
    0
      .dockerignore
  2. 15
    0
      Dockerfile
  3. 13
    0
      README.md
  4. 2
    0
      src/AppRoutes.tsx

+ 12
- 0
.dockerignore View File

# 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/

+ 15
- 0
Dockerfile View File

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"]

+ 13
- 0
README.md View File



## Available Scripts ## Available Scripts


## Docker Scripts

### Create docker container
### `docker build -t diligent-react-ts .`

### Start docker container
### `docker run --rm -p 3000:3000 --name diligent-template-ts diligent-react-ts`

### Stop docker container
### `docker stop diligent-template-ts`

### For more information see Dockerfile

In the project directory, you can run: In the project directory, you can run:


### `yarn start` ### `yarn start`

+ 2
- 0
src/AppRoutes.tsx View File

FORGOT_PASSWORD_PAGE, FORGOT_PASSWORD_PAGE,
NOT_FOUND_PAGE, NOT_FOUND_PAGE,
ERROR_PAGE, ERROR_PAGE,
BASE_PAGE,
} from "./constants/pages"; } from "./constants/pages";


// import LoginPage from './pages/LoginPage/LoginPage'; // import LoginPage from './pages/LoginPage/LoginPage';
const AppRoutes = () => ( const AppRoutes = () => (
<Routes> <Routes>
<Route path="*" element={<NotFoundPage />} /> <Route path="*" element={<NotFoundPage />} />
<Route path={BASE_PAGE} element={<LoginPage />} />
<Route path={LOGIN_PAGE} element={<LoginPage />} /> <Route path={LOGIN_PAGE} element={<LoginPage />} />
<Route path={NOT_FOUND_PAGE} element={<NotFoundPage />} /> <Route path={NOT_FOUND_PAGE} element={<NotFoundPage />} />
<Route path={ERROR_PAGE} element={<ErrorPage />} /> <Route path={ERROR_PAGE} element={<ErrorPage />} />

Loading…
Cancel
Save