Sfoglia il codice sorgente

Added Dockerfile

master
Lazar Kostic 3 anni fa
parent
commit
d71c8e7d65
4 ha cambiato i file con 42 aggiunte e 0 eliminazioni
  1. 12
    0
      .dockerignore
  2. 15
    0
      Dockerfile
  3. 13
    0
      README.md
  4. 2
    0
      src/AppRoutes.tsx

+ 12
- 0
.dockerignore Vedi File

@@ -0,0 +1,12 @@
# 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 Vedi File

@@ -0,0 +1,15 @@
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 Vedi File

@@ -4,6 +4,19 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo

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

### `yarn start`

+ 2
- 0
src/AppRoutes.tsx Vedi File

@@ -7,6 +7,7 @@ import {
FORGOT_PASSWORD_PAGE,
NOT_FOUND_PAGE,
ERROR_PAGE,
BASE_PAGE,
} from "./constants/pages";

// import LoginPage from './pages/LoginPage/LoginPage';
@@ -22,6 +23,7 @@ import PrivateRoute from "./components/Router/PrivateRoute";
const AppRoutes = () => (
<Routes>
<Route path="*" element={<NotFoundPage />} />
<Route path={BASE_PAGE} element={<LoginPage />} />
<Route path={LOGIN_PAGE} element={<LoginPage />} />
<Route path={NOT_FOUND_PAGE} element={<NotFoundPage />} />
<Route path={ERROR_PAGE} element={<ErrorPage />} />

Loading…
Annulla
Salva