Skip to content

Commit 42244bb

Browse files
authored
Merge pull request #11 from weaponsforge/feature/weaponsforge-1
Feature/weaponsforge 1b
2 parents 6893062 + 014e54a commit 42244bb

File tree

7 files changed

+108
-0
lines changed

7 files changed

+108
-0
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
.github
3+
.gitignore
4+
.dockerignore
5+
.vercel
6+
node_modules
7+
npm-debug.log
8+
Dockerfile

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,27 @@ The following dependecies are used for this project. Feel free to experiment usi
2727

2828
2. Follow the instructions on the README files inside the `/client` directory for more information on configuring and using the NextJS client app.
2929

30+
## Quick Usage Guide
31+
32+
### Manual Installation and Usage
33+
34+
1. Navigate to the **/client** directory from the commandline.
35+
2. Run: `npm run install`
36+
3. Run: `npm run dev`
37+
38+
### Localhost Development Using Docker
39+
40+
> **NOTE:** Requires Docker installed on the development machine.
41+
42+
1. Navigate the the repository's root directory from the commandline.
43+
2. Run the docker compose commands:<br>
44+
```
45+
# Build the image
46+
docker compose build
47+
48+
# Start/stop the docker image
49+
docker compose up/down
50+
```
51+
3052
@weaponsforge<br>
3153
20230319

client/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.git
2+
.gitignore
3+
.dockerignore
4+
node_modules
5+
npm-debug.log
6+
Dockerfile

client/.eslintignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel

client/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:18.14.2-alpine as base
2+
RUN mkdir -p /opt/client
3+
WORKDIR /opt/client
4+
RUN adduser -S client
5+
RUN chown -R client /opt/client
6+
COPY package*.json ./
7+
8+
# DEVELOPMENT CLIENT PROFILE
9+
FROM base as development
10+
ENV NODE_ENV=development
11+
RUN npm install && npm cache clean --force
12+
COPY . ./
13+
EXPOSE 3000
14+
CMD ["npm", "run", "dev"]

client/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ http://localhost:3000
3434
### `npm run lint`
3535
Check for lint errors.
3636

37+
### npm run lint:fix
38+
Fix lint errors.
39+
3740
### `npm run export`
3841
Export the static website.
3942

docker-compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: "3"
2+
services:
3+
# NextJS v13 app running on development mode
4+
react-hooks-playground-client-dev:
5+
container_name: react-hooks-playground-client-dev
6+
image: weaponsforge/react-hooks-playground-client:dev
7+
build:
8+
context: ./client
9+
dockerfile: Dockerfile
10+
target: development
11+
networks:
12+
- react-hooks-playground-dev
13+
volumes:
14+
- ./client:/opt/client
15+
- /opt/client/node_modules
16+
- /opt/client/.next
17+
ports:
18+
- "3000:3000"
19+
20+
networks:
21+
react-hooks-playground-dev:
22+
name: react-hooks-playground-dev
23+
external: false

0 commit comments

Comments
 (0)