From 87d16a1f67c2cf90e40537c6155825e84eb9c06d Mon Sep 17 00:00:00 2001 From: Skylar Brown Date: Wed, 5 May 2021 16:11:10 -0700 Subject: [PATCH 1/3] be more specific about our language versions --- README.md | 13 +++++++++---- frontend/.npmrc | 1 + frontend/Dockerfile | 2 +- frontend/package.json | 4 ++++ go/Dockerfile | 2 +- java/Dockerfile | 2 ++ node/.npmrc | 1 + node/Dockerfile | 6 ++++-- node/package.json | 4 ++++ python/.python-version | 1 + python/Dockerfile | 2 +- ruby/Dockerfile | 2 +- ruby/Gemfile | 1 + 13 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 python/.python-version diff --git a/README.md b/README.md index 3edc7aff..5e4d15f5 100644 --- a/README.md +++ b/README.md @@ -129,11 +129,16 @@ $ make stop language=node #### Pre-requisites -- The language you intend to use is installed on your machine and available at your command line. - This repo should generally work with active LTS versions of each language such as node >= 14, - python >= 3.8, ruby >= 2.6, etc. +- The backend language you intend to use is installed on your machine and available at your command line. + This repo should generally work with the latest active LTS versions of each language, and language version + files such as `.nvmrc`, `.python-version`, etc are included in each directory for use with popular version management utilities. + - Node 14, npm 6 + - Python 3.8 + - Ruby 2.7 + - Java 16 + - Go 1.16 +- [Node 14](https://nodejs.org/en/download/) with the default `npm` version 6 (for running the frontend). - Your environment variables populated in `.env` -- [npm](https://www.npmjs.com/get-npm) - If using Windows, a command line utility capable of running basic Unix shell commands #### 1. Running the backend diff --git a/frontend/.npmrc b/frontend/.npmrc index 19dd2939..8684cd60 100644 --- a/frontend/.npmrc +++ b/frontend/.npmrc @@ -1 +1,2 @@ registry=https://registry.npmjs.com +engine-strict=true diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5ee1bd0c..4e61e809 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,5 @@ # pull official base image -FROM node:lts-alpine +FROM node:14-alpine # set working directory WORKDIR /app diff --git a/frontend/package.json b/frontend/package.json index 90d69fa8..6087ed01 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,5 +1,9 @@ { "name": "plaid_react_quickstart", + "engines": { + "node": "^14", + "npm": "^6" + }, "version": "0.1.0", "dependencies": { "@testing-library/jest-dom": "^5.11.4", diff --git a/go/Dockerfile b/go/Dockerfile index 1edca997..0f5bb222 100644 --- a/go/Dockerfile +++ b/go/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.12 AS build +FROM golang:1.16 AS build WORKDIR /opt/src COPY . . diff --git a/java/Dockerfile b/java/Dockerfile index b5631fef..db31f6ca 100644 --- a/java/Dockerfile +++ b/java/Dockerfile @@ -1,5 +1,7 @@ FROM maven:openjdk +RUN java --version + WORKDIR /opt/app COPY . . WORKDIR /opt/app/java diff --git a/node/.npmrc b/node/.npmrc index 19dd2939..8684cd60 100644 --- a/node/.npmrc +++ b/node/.npmrc @@ -1 +1,2 @@ registry=https://registry.npmjs.com +engine-strict=true diff --git a/node/Dockerfile b/node/Dockerfile index c114dc88..5307d460 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -1,4 +1,6 @@ -FROM node:alpine +FROM node:14-alpine + +RUN node --version WORKDIR /opt/app RUN chown -R node:node /opt/app @@ -11,4 +13,4 @@ COPY --chown=node:node ./node/index.js ./ EXPOSE 8000 ENTRYPOINT ["node"] -CMD ["index.js"] \ No newline at end of file +CMD ["index.js"] diff --git a/node/package.json b/node/package.json index dd33cdab..39ac3665 100644 --- a/node/package.json +++ b/node/package.json @@ -1,5 +1,9 @@ { "name": "plaid-node-walkthrough", + "engines": { + "node": "^14", + "npm": "^6" + }, "version": "0.1.0", "description": "A sample app and accompanying walkthrough for the Plaid API.", "main": "index.js", diff --git a/python/.python-version b/python/.python-version new file mode 100644 index 00000000..d20cc2bf --- /dev/null +++ b/python/.python-version @@ -0,0 +1 @@ +3.8.10 diff --git a/python/Dockerfile b/python/Dockerfile index 54cded1b..97a55338 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -1,4 +1,4 @@ -FROM python:alpine +FROM python:3.8-alpine WORKDIR /opt/app COPY . . diff --git a/ruby/Dockerfile b/ruby/Dockerfile index be66ebb6..abd99f4a 100644 --- a/ruby/Dockerfile +++ b/ruby/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2-alpine +FROM ruby:2.7-alpine WORKDIR /opt/app COPY . . diff --git a/ruby/Gemfile b/ruby/Gemfile index 9d0ef17d..ba2efcc2 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' +ruby '2.7.1' gem 'sinatra' From 3f1de705f4ac012346082ef66313bdee81a6d397 Mon Sep 17 00:00:00 2001 From: Skylar Brown Date: Wed, 5 May 2021 16:15:18 -0700 Subject: [PATCH 2/3] gemfile --- ruby/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/Gemfile b/ruby/Gemfile index ba2efcc2..31eac17e 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.7.1' +ruby '~> 2.7' gem 'sinatra' From 58b4d6157a5f2ec0f367edf4a1cbb23ded060958 Mon Sep 17 00:00:00 2001 From: Skylar Brown Date: Wed, 5 May 2021 17:45:04 -0700 Subject: [PATCH 3/3] remove log lines --- java/Dockerfile | 2 -- node/Dockerfile | 2 -- 2 files changed, 4 deletions(-) diff --git a/java/Dockerfile b/java/Dockerfile index db31f6ca..b5631fef 100644 --- a/java/Dockerfile +++ b/java/Dockerfile @@ -1,7 +1,5 @@ FROM maven:openjdk -RUN java --version - WORKDIR /opt/app COPY . . WORKDIR /opt/app/java diff --git a/node/Dockerfile b/node/Dockerfile index 5307d460..71061dc4 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -1,7 +1,5 @@ FROM node:14-alpine -RUN node --version - WORKDIR /opt/app RUN chown -R node:node /opt/app COPY --chown=node:node ./node/package*.json /opt/app/