Quellcode durchsuchen

Added Dockerfile and updated Reade

react-update-18
Lazar Kostic vor 3 Jahren
Ursprung
Commit
66fb01795f
4 geänderte Dateien mit 59 neuen und 2 gelöschten Zeilen
  1. 12
    0
      .dockerignore
  2. 36
    0
      Dockerfile
  3. 11
    0
      README.md
  4. 0
    2
      src/pages/LoginPage/LoginPageMUI.js

+ 12
- 0
.dockerignore Datei anzeigen

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

+ 36
- 0
Dockerfile Datei anzeigen

@@ -0,0 +1,36 @@
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" ]

+ 11
- 0
README.md Datei anzeigen

@@ -2,8 +2,19 @@

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).


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

### `npm start`

+ 0
- 2
src/pages/LoginPage/LoginPageMUI.js Datei anzeigen

@@ -34,8 +34,6 @@ const LoginPage = () => {
const { t } = useTranslation();
const error = useSelector(selectLoginError);

console.log('error', error);

const [showPassword, setShowPassword] = useState(false);
const handleClickShowPassword = () => setShowPassword(!showPassword);
const handleMouseDownPassword = () => setShowPassword(!showPassword);

Laden…
Abbrechen
Speichern