From 77550c0768372f33da39b22200da38e7a1ea00c1 Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Sun, 19 Mar 2023 04:11:51 +0800 Subject: [PATCH 1/5] chore: Update README --- client/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/README.md b/client/README.md index b4e5754..63426da 100644 --- a/client/README.md +++ b/client/README.md @@ -34,6 +34,9 @@ http://localhost:3000 ### `npm run lint` Check for lint errors. +### npm run lint:fix +Fix lint errors. + ### `npm run export` Export the static website. From 563b75d66b0337fe7411995a1b9f03fe525dfaee Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Sun, 19 Mar 2023 04:23:17 +0800 Subject: [PATCH 2/5] chore: Add docker setup for client localhost development --- README.md | 15 +++++++++++++++ client/Dockerfile | 14 ++++++++++++++ docker-compose.yml | 23 +++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 client/Dockerfile create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 428ae06..a87b89b 100644 --- a/README.md +++ b/README.md @@ -27,5 +27,20 @@ The following dependecies are used for this project. Feel free to experiment usi 2. Follow the instructions on the README files inside the `/client` directory for more information on configuring and using the NextJS client app. +## Quick Usage Guide + +### Manual Installation and Usage + +1. Navigate to the **/client** directory from the commandline. +2. Run: `npm run install` +3. Run: `npm run dev` + +### Localhost Development Using Docker + +> **NOTE:** Requires Docker installed on the development machine. + +1. Navogate the the repository's root directory from the commandline. +2. Run: `docker compose up` + @weaponsforge
20230319 diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..8724c29 --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,14 @@ +FROM node:18.14.2-alpine as base +RUN mkdir -p /opt/client +WORKDIR /opt/client +RUN adduser -S client +RUN chown -R client /opt/client +COPY package*.json ./ + +# DEVELOPMENT CLIENT PROFILE +FROM base as development +ENV NODE_ENV=development +RUN npm install && npm cache clean --force +COPY . ./ +EXPOSE 3000 +CMD ["npm", "run", "dev"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1f48c74 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3" +services: + # NextJS v13 app running on development mode + react-hooks-playground-client-dev: + container_name: react-hooks-playground-client-dev + image: weaponsforge/react-hooks-playground-client:dev + build: + context: ./client + dockerfile: Dockerfile + target: development + networks: + - react-hooks-playground-dev + volumes: + - ./client:/opt/client + - /opt/client/node_modules + - /opt/client/.next + ports: + - "3000:3000" + +networks: + react-hooks-playground-dev: + name: react-hooks-playground-dev + external: false From 15df7f10246ea7c305a018c0a0e73c49e9050574 Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Sun, 19 Mar 2023 04:25:55 +0800 Subject: [PATCH 3/5] chore: Add dockerignore files --- .dockerignore | 8 ++++++++ client/.dockerignore | 6 ++++++ client/.eslintignore | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 .dockerignore create mode 100644 client/.dockerignore create mode 100644 client/.eslintignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..854ebfa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.github +.gitignore +.dockerignore +.vercel +node_modules +npm-debug.log +Dockerfile diff --git a/client/.dockerignore b/client/.dockerignore new file mode 100644 index 0000000..ca47e9a --- /dev/null +++ b/client/.dockerignore @@ -0,0 +1,6 @@ +.git +.gitignore +.dockerignore +node_modules +npm-debug.log +Dockerfile diff --git a/client/.eslintignore b/client/.eslintignore new file mode 100644 index 0000000..55175ef --- /dev/null +++ b/client/.eslintignore @@ -0,0 +1,32 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel From 566f03033e1af30c809f0429c496f4029f9d7dfc Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Sun, 19 Mar 2023 04:27:36 +0800 Subject: [PATCH 4/5] chore: Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a87b89b..cff179b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ The following dependecies are used for this project. Feel free to experiment usi > **NOTE:** Requires Docker installed on the development machine. -1. Navogate the the repository's root directory from the commandline. +1. Navigate the the repository's root directory from the commandline. 2. Run: `docker compose up` @weaponsforge
From 014e54aaf7e8e6447d07a503ea5cf9964fc2c2e3 Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Sun, 19 Mar 2023 04:35:33 +0800 Subject: [PATCH 5/5] chore: Update README --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cff179b..1e9c464 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,14 @@ The following dependecies are used for this project. Feel free to experiment usi > **NOTE:** Requires Docker installed on the development machine. 1. Navigate the the repository's root directory from the commandline. -2. Run: `docker compose up` +2. Run the docker compose commands:
+ ``` + # Build the image + docker compose build + + # Start/stop the docker image + docker compose up/down + ``` @weaponsforge
20230319