Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.github
.gitignore
.dockerignore
.vercel
node_modules
npm-debug.log
Dockerfile
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,27 @@ 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. Navigate the the repository's root directory from the commandline.
2. Run the docker compose commands:<br>
```
# Build the image
docker compose build

# Start/stop the docker image
docker compose up/down
```

@weaponsforge<br>
20230319
6 changes: 6 additions & 0 deletions client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.gitignore
.dockerignore
node_modules
npm-debug.log
Dockerfile
32 changes: 32 additions & 0 deletions client/.eslintignore
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 3 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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