Skip to content

Commit 4b9b667

Browse files
authored
Upgraded package.json (#31)
1 parent ad489f7 commit 4b9b667

21 files changed

+22800
-18362
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- name: Checkout source code
1616
uses: actions/checkout@master
17-
- name: set inotify
17+
- name: Set inotify
1818
run: |
1919
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
20-
- name: docker hub login
20+
- name: Login DockerHub
2121
run: |
2222
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin $REGISTRY_DOMAIN
2323
- name: Build api dev image
@@ -40,6 +40,18 @@ jobs:
4040
cd backend
4141
docker build . --target build-stage --build-arg NODE_ENV=development --build-arg BASE_URL=/backend/ -t $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:backend-dev
4242
docker push $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:backend-dev
43+
- name: Lint Dockerfile for api
44+
uses: hadolint/[email protected]
45+
with:
46+
dockerfile: api/Dockerfile
47+
- name: Lint Dockerfile for frontend-nuxt
48+
uses: hadolint/[email protected]
49+
with:
50+
dockerfile: frontend-nuxt/Dockerfile
51+
- name: Lint Dockerfile for vue
52+
uses: hadolint/[email protected]
53+
with:
54+
dockerfile: frontend-vue/Dockerfile
4355
- name: Run docker compose for dev
4456
run: |
4557
docker-compose -f docker-compose.actions.yml pull

.gitlab-ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ build-backend:
6363
$REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:backend-dev
6464
- docker push $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:backend-dev
6565

66+
lint-dockerfile:
67+
stage: testing
68+
image: hadolint/hadolint:latest
69+
script:
70+
- hadolint api/Dockerfile
71+
- hadolint frontend-nuxt/Dockerfile
72+
- hadolint frontend-vue/Dockerfile
73+
6674
testing-and-linting:
6775
stage: testing
6876
image: docker/compose:latest

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"source.fixAll.eslint": true
2020
},
2121
"cSpell.words": [
22+
"hadolint",
2223
"mailhog",
2324
"nuxt"
2425
]

api/Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# development stage
2-
FROM node:13-alpine AS dev-stage
2+
FROM node:16-alpine3.13 AS dev-stage
33

4-
RUN apk update && apk add --no-cache python make g++ mysql-client
4+
RUN apk update && \
5+
apk add --no-cache \
6+
python3=3.8.10-r0 \
7+
make=4.3-r0 \
8+
g++=10.2.1_pre1-r3 \
9+
mysql-client=10.5.11-r0
510

611
# Add configuration files
712
COPY image-files/ /
813

9-
1014
WORKDIR /srv
1115

1216
COPY package*.json ./
@@ -24,15 +28,14 @@ CMD [ "npm", "run", "dev" ]
2428
# build stage
2529
FROM dev-stage AS build-stage
2630

27-
28-
RUN npm install --production
29-
30-
RUN npm run build
31+
RUN npm install --production && \
32+
npm run build && \
33+
npm audit fix
3134

3235
# production stage
33-
FROM node:13-alpine AS production-stage
36+
FROM node:16-alpine3.13 AS production-stage
3437

35-
RUN apk update && apk add --no-cache mysql-client
38+
RUN apk update && apk add --no-cache mysql-client=10.5.10-r0
3639

3740
# Add configuration files
3841
COPY image-files/ /

0 commit comments

Comments
 (0)