Skip to content

Commit

Permalink
Upgrades dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-mccarthy committed Feb 13, 2024
1 parent 799144a commit 95d7a7a
Show file tree
Hide file tree
Showing 5 changed files with 1,760 additions and 849 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bullseye-slim
FROM node:20-bookworm-slim

# Set up directories in advance so we can control the permissions
RUN mkdir -p /usr/app/bin && mkdir -p /usr/app/node_modules && chown -R node:node /usr/app
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Microservices are becoming the name of the game. Much what we are building are API-only microservices. Here's a template to get started quickly!

## Getting started

Search and replace `express-docker-template` with the name of your service (slugified). Then run `bash ./rebuild` to start up. Then begin development!

## File descriptions

**build-image** | This script will bake a fresh docker image with all of your code and push it to docker hub using the current timestamp as a tag. Modify this file to reflect the username/repo_name of your image's repo and it will do the rest
Expand All @@ -15,7 +19,7 @@ One of two ways to do this is to add an `nginx` rule to the `local.tools.newsday
1. Go to the `sites-available` directory located in `<your virtual_machines directory->/proxy/nginx-config/`
2. Open the file `local.tools.newsday.com.conf` in your preferred text editor.

To open the file in `nano` for example use the command `nano local.tools.newsday.conf`
To open the file in `nano` for example use the command `nano local.tools.newsday.conf`

3. Inside the file you will find various rules for different microservices that follow a similar format. Use the format below to add an additional rule for your microservice, note the braces mark the rule blocks so ensure your rule isn't placed inside another rule block.

Expand All @@ -27,7 +31,6 @@ location ~ /<preferred URL for microservice>(.*) {
}
```

where `hostname` is the `hostname` for your microservice as defined in its `docker-compose.yaml` file.
4. Save, exit and then restart Docker (one is to click the docker icon in the menu bar on the tip and click "Restart").
where `hostname` is the `hostname` for your microservice as defined in its `docker-compose.yaml` file. 4. Save, exit and then restart Docker (one is to click the docker icon in the menu bar on the tip and click "Restart").

Ensure your microservice is running (execute the `bash rebuild` command) then navigate to `local.tools.newsday.com/<your microservice endpoint>` and you should be able to see some message indicating the microservice is online.
17 changes: 10 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
version: '3'
version: "3"

## Search and replace 'express-docker-template' with the name of the service

services:
service-name:
container_name: service-name
hostname: service-name
express-docker-template:
container_name: express-docker-template
hostname: express-docker-template
volumes:
- .:/usr/app
- /usr/app/node_modules
Expand All @@ -14,11 +16,12 @@ services:
- ENV
- BUILD_VERSION=local-build # DO NOT SPECIFY WHEN DEPLOYING TO STAGE
- NODE_ENV=${ENV} # CAN ONLY BE 'local' OR 'production', hardcode to 'production' WHEN DEPLOYING TO STAGE AND PROD
- NODE_OPTIONS=--enable-source-maps
logging:
driver: 'json-file'
driver: "json-file"
options:
max-size: '5m'
max-file: '2'
max-size: "5m"
max-file: "2"
networks:
default:
name: special-projects
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-docker-template",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"scripts": {
"dev": "npx eslint --fix --ext 'js' .; npx webpack watch --mode development",
Expand All @@ -15,22 +15,22 @@
"morgan": "^1.9.1"
},
"devDependencies": {
"@babel/core": "^7.18.0",
"@babel/eslint-parser": "^7.17.0",
"@babel/preset-env": "^7.18.0",
"babel-loader": "^8.2.5",
"eslint": "^8.16.0",
"@babel/core": "^7.23.9",
"@babel/eslint-parser": "^7.23.10",
"@babel/preset-env": "^7.23.9",
"babel-loader": "^9.1.3",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-proposal": "^2.3.3",
"eslint-webpack-plugin": "^3.1.1",
"nodemon": "^2.0.22",
"nodemon-webpack-plugin": "^4.8.0",
"terser-webpack-plugin": "^5.3.3",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.0"
"eslint-webpack-plugin": "^4.0.1",
"nodemon": "^3.0.3",
"nodemon-webpack-plugin": "^4.8.2",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.1"
}
}
Loading

0 comments on commit 95d7a7a

Please sign in to comment.