Skip to content

Commit 6c153c8

Browse files
committed
init
1 parent 5aa7afa commit 6c153c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+49550
-1
lines changed

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.dockerignore
2+
.git*
3+
.husky/
4+
.prettierrc
5+
.vscode/
6+
CODE_OF_CONDUCT.md
7+
README.md
8+
build/
9+
docker/Dockerfile
10+
node_modules/

.env

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CI= npm run build
2+
REACT_APP_GAME_NAME=Reactle
3+
REACT_APP_GAME_DESCRIPTION=A daily word puzzle
4+
REACT_APP_LOCALE_STRING=

.github/workflows/lint.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Prettify code
14+
uses: creyD/[email protected]
15+
with:
16+
prettier_options: --check src

.github/workflows/test.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- run: |
14+
npm install
15+
- run: |
16+
npm run test

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
.idea
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

.prettierrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
singleQuote: true
2+
semi: false

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
run:
2+
@echo "\033[0;34m[#] Killing old docker processes\033[0m"
3+
docker-compose down -v -t 1
4+
5+
@echo "\033[0;34m[#] Building docker containers\033[0m"
6+
docker-compose up --build -d
7+
8+
@echo "\e[32m[#] Containers are now running!\e[0m"

README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1-
# devops
1+
# devops 💻
2+
3+
A DevOpsDaysLA workshop for building and deploying a wordle clone
4+
5+
## Running Locally 🔨
6+
7+
For running locally, you have two options:
8+
9+
- npm
10+
- docker-compose
11+
12+
### npm
13+
14+
Simply run the following commands to start the app with npm:
15+
16+
```bash
17+
npm install
18+
npm run start
19+
```
20+
21+
> Checkout the application running in your browser at [localhost:3000](http://localhost:3000)
22+
23+
### docker-compose
24+
25+
To run the application locally with docker-compose, run the following command:
26+
27+
```bash
28+
make run
29+
```
30+
31+
This project uses a Makefile to wrap the docker-compose commands into a one liner
32+
33+
> Checkout the application running in your browser at [localhost:3000](http://localhost:3000)

docker-compose.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# To build the entire stack run 'make run'
2+
3+
services:
4+
reactle:
5+
container_name: reactle
6+
restart: unless-stopped
7+
build:
8+
context: .
9+
dockerfile: ./docker/app/Dockerfile
10+
ports:
11+
- 3000:3000
12+
healthcheck:
13+
test: ["CMD", "curl", "-f", "http://localhost:3000"]
14+
interval: 30s
15+
timeout: 5s
16+
retries: 3
17+
start_period: 15s

docker/app/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:16.14.0-alpine3.14 AS base
2+
RUN adduser -D nonroot
3+
WORKDIR /app
4+
COPY package-lock.json package.json ./
5+
RUN npm install
6+
COPY --chown=nonroot:nonroot . .
7+
8+
FROM base AS prod
9+
RUN npm run build
10+
RUN chown -R nonroot:nonroot /app/node_modules/.cache
11+
12+
EXPOSE 3000
13+
USER nonroot
14+
CMD npm run start

0 commit comments

Comments
 (0)