Skip to content

Commit

Permalink
update: dependencies & base image
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyslavvolkov committed Aug 31, 2022
1 parent f3354d2 commit c931032
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 34 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Cache artifacts
uses: actions/cache@v3
continue-on-error: true
with:
path: {{.github.workspace}}/.skaffold/cache
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-
- name: Build Docker images
uses: hiberbee/[email protected]
with:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@

#### NodeJS

[Dockerfile](images/build/Dockerfile)
[Dockerfile](packages/yarn/Dockerfile)

This image used for assembling NodeJS-based applications. Includes Yarn 3 cached packages from `package.json` as [@bn-digital](https://github.com/bn-digital) technology stack foundation.

### Runtime

#### HTML

[Dockerfile](images/runtime/Dockerfile)
[Dockerfile](packages/nodejs/Dockerfile)

```dockerfile
FROM nginx/unit:${unit_version}-minimal AS html
```

#### NodeJS

[Dockerfile](images/runtime/Dockerfile)
[Dockerfile](packages/nodejs/Dockerfile)

```dockerfile
FROM node:${nodejs_version}-bullseye-slim AS nodejs
```

#### PHP

[Dockerfile](images/runtime/Dockerfile)
[Dockerfile](packages/nodejs/Dockerfile)

```dockerfile
FROM nginx/unit:${unit_version}-php${php_version} AS php
Expand Down
File renamed without changes.
11 changes: 5 additions & 6 deletions images/runtime/Dockerfile → packages/nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# syntax docker/dockerfile:latest
ARG unit_version=1.26.1
ARG php_version=8.1
ARG nodejs_version="18"
ARG os_version="bullseye-slim"
FROM node:${nodejs_version}-${os_version} AS nodejs-base

FROM nodejs-base AS nodejs
FROM node:${nodejs_version}-${os_version}
LABEL org.opencontainers.image.authors="BN Enginseers" \
org.opencontainers.image.vendor="BN Digital" \
org.opencontainers.image.title="NodeJS" \
org.opencontainers.image.url="https://github.com/bn-digital/docker" \
org.opencontainers.image.base.name="dcr.bndigital.dev/library/nodejs" \
org.opencontainers.image.source="https://github.com/bn-digital/docker" \
org.opencontainers.image.vendor="BN Digital" \
org.opencontainers.image.licenses="MIT"
ENV NODE_NO_WARNINGS=1
ENV HOST=0.0.0.0
ENV PORT=5000
ENV NODE_ENV=production
EXPOSE $PORT
RUN npm install --global \
RUN npm install --location=global \
serve \
npm
USER node
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion images/build/Dockerfile → packages/yarn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax docker/dockerfile:latest
ARG nodejs_version="18"
ARG os_version="bullseye-slim"
FROM node:${nodejs_version}-${os_version} AS yarn
FROM node:${nodejs_version}-${os_version}
RUN apt-get update --fix-missing \
&& apt-get upgrade --yes \
&& apt-get dist-upgrade --yes \
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
"commander": "^9.4.0",
"core-js": "^3.25.0",
"cross-env": "^7.0.3",
"cypress": "^10.6.0",
"date-fns": "^2.29.2",
"dotenv": "^16.0.1",
"dotenv": "^16.0.2",
"esbuild": "^0.15.6",
"graphql": "^16.6.0",
"gsap": "^3.11.0",
Expand All @@ -73,7 +72,7 @@
"react-router": "^6.4.0-pre.13",
"react-router-dom": "^6.4.0-pre.13",
"react-use": "^17.4.0",
"sass": "^1.54.6",
"sass": "^1.54.7",
"sharp": "^0.30.7",
"sqlite3": "^5.0.11",
"strapi-plugin-config-sync": "^1.0.3",
Expand All @@ -97,7 +96,7 @@
"@types/react-router-hash-link": "^2.4.5",
"@types/uuid": "^8.3.4",
"@vscode/sqlite3": "^5.0.8",
"cypress": "^10.6.0",
"cypress": "^10.7.0",
"nodemon": "^2.0.19",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
Expand Down
File renamed without changes.
29 changes: 18 additions & 11 deletions images/build/app/yarn.lock → packages/yarn/app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5325,9 +5325,9 @@ __metadata:
commander: "npm:^9.4.0"
core-js: "npm:^3.25.0"
cross-env: "npm:^7.0.3"
cypress: "npm:^10.6.0"
cypress: "npm:^10.7.0"
date-fns: "npm:^2.29.2"
dotenv: "npm:^16.0.1"
dotenv: "npm:^16.0.2"
esbuild: "npm:^0.15.6"
graphql: "npm:^16.6.0"
gsap: "npm:^3.11.0"
Expand All @@ -5354,7 +5354,7 @@ __metadata:
react-router: "npm:^6.4.0-pre.13"
react-router-dom: "npm:^6.4.0-pre.13"
react-use: "npm:^17.4.0"
sass: "npm:^1.54.6"
sass: "npm:^1.54.7"
sharp: "npm:^0.30.7"
sqlite3: "npm:^5.0.11"
strapi-plugin-config-sync: "npm:^1.0.3"
Expand Down Expand Up @@ -14584,9 +14584,9 @@ __metadata:
languageName: node
linkType: hard

"cypress@npm:^10.6.0":
version: 10.6.0
resolution: "cypress@npm:10.6.0"
"cypress@npm:^10.7.0":
version: 10.7.0
resolution: "cypress@npm:10.7.0"
dependencies:
"@cypress/request": "npm:^2.88.10"
"@cypress/xvfb": "npm:^1.2.4"
Expand Down Expand Up @@ -14632,7 +14632,7 @@ __metadata:
yauzl: "npm:^2.10.0"
bin:
cypress: bin/cypress
checksum: 3c64a924158d5cffe7048cdfbeb0dbcacdb4bdce0e3e469e183360713a25755278b59c6eff903223916cfa4fd3905135e604817329e2bad3949c04eed23a2c64
checksum: 3ad2c992cc4379db39b456c21822413ea4e87b18934853c05c06f28373eb13adf6c3c414ba958b36921241bc161eff74edc2381729cd677543077324350cd77a
languageName: node
linkType: hard

Expand Down Expand Up @@ -15673,6 +15673,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.0.2":
version: 16.0.2
resolution: "dotenv@npm:16.0.2"
checksum: 5d6641fbee9e169fdea93c4952c9559230418d9de58ce7c9cb49ae8bca5445686fd8222f952a0b916baa1119eaa4be76d096c3db795395bbf3c0bb1c85e33f8c
languageName: node
linkType: hard

"dotenv@npm:^8.2.0":
version: 8.6.0
resolution: "dotenv@npm:8.6.0"
Expand Down Expand Up @@ -30809,16 +30816,16 @@ __metadata:
languageName: node
linkType: hard

"sass@npm:^1.54.6":
version: 1.54.6
resolution: "sass@npm:1.54.6"
"sass@npm:^1.54.7":
version: 1.54.7
resolution: "sass@npm:1.54.7"
dependencies:
chokidar: "npm:>=3.0.0 <4.0.0"
immutable: "npm:^4.0.0"
source-map-js: "npm:>=0.6.2 <2.0.0"
bin:
sass: sass.js
checksum: 3d38b672e06e9e87dbeb329dd6cfef21ca09f4441d69faa517282379e319fb6817d8d173cb9aede571d328dc0e689039597d89cc0cd14db52aa8eef294f7c5d3
checksum: 484d49852029f05d4bdbe6e006856a256f74e252362613a72cda24dd690c4401040d0b206a6747e58db51f411597b60e6348733523d72cf4af8a6092f07fd0ec
languageName: node
linkType: hard

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 7 additions & 8 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ kind: Config
build:
artifacts:
- image: yarn
context: images/build
docker:
target: yarn
context: packages/yarn
- image: openvpn
context: images/openvpn
context: packages/openvpn
- image: nodejs
context: images/runtime
docker:
target: nodejs
context: packages/nodejs
- image: dind
context: images/dind
context: packages/nodejs
tagPolicy:
sha256: { }
local:
Expand All @@ -30,6 +26,9 @@ test:
- nodejs-container-structure-test.yaml
- runtime-container-structure-test.yaml
profiles:
- name: staging
activation:
- env: CI=true
- name: production
build:
tagPolicy:
Expand Down

0 comments on commit c931032

Please sign in to comment.