Skip to content

Commit 2cdc3e8

Browse files
committed
Node -> 18
- Node 18 changes the resolution of `localhost` to ::1 (ipv6) instead of 127.0.0.1 (ipv4). In CI, we must tell Docker to map port 5432 (postgres) on ipv6 instead of ipv4. - Node 18 no longer spawns yarn.cmd with { shell: true } by default, so in `scripts/lib/run.js`, we now set it explicitly if we detect that the OS is win32.
1 parent 5f37787 commit 2cdc3e8

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

.github/workflows/cypress.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [16.x]
18+
node-version: [18.x]
1919

2020
services:
2121
postgres:
@@ -25,7 +25,7 @@ jobs:
2525
POSTGRES_PASSWORD: postgres
2626
POSTGRES_DB: postgres
2727
ports:
28-
- "0.0.0.0:5432:5432"
28+
- ":::5432:5432"
2929
# needed because the postgres container does not provide a healthcheck
3030
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3131

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [16.x]
16+
node-version: [18.x]
1717

1818
services:
1919
postgres:
@@ -23,7 +23,7 @@ jobs:
2323
POSTGRES_PASSWORD: postgres
2424
POSTGRES_DB: postgres
2525
ports:
26-
- "0.0.0.0:5432:5432"
26+
- ":::5432:5432"
2727
# needed because the postgres container does not provide a healthcheck
2828
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2929

.github/workflows/pgrita.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [16.x]
11+
node-version: [18.x]
1212

1313
services:
1414
postgres:
@@ -18,7 +18,7 @@ jobs:
1818
POSTGRES_PASSWORD: postgres
1919
POSTGRES_DB: postgres
2020
ports:
21-
- "0.0.0.0:5432:5432"
21+
- ":::5432:5432"
2222
# needed because the postgres container does not provide a healthcheck
2323
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2424

.github/workflows/production-docker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [16.x]
11+
node-version: [18.x]
1212

1313
services:
1414
postgres:
@@ -18,7 +18,9 @@ jobs:
1818
POSTGRES_PASSWORD: postgres
1919
POSTGRES_DB: postgres
2020
ports:
21-
- "0.0.0.0:5432:5432"
21+
- ":::5432:5432"
22+
# docker bridge gateway
23+
- "172.17.0.1:5432:5432"
2224
# needed because the postgres container does not provide a healthcheck
2325
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2426

.github/workflows/windows-nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
git config --global core.eol lf
2121
- name: Checkout
2222
uses: actions/checkout@v2
23-
- name: Use Node.js 16
23+
- name: Use Node.js 18
2424
uses: actions/setup-node@v1
2525
with:
26-
node-version: "16"
26+
node-version: "18"
2727
- name: Start Postgres 14
2828
run: |
2929
sc config postgresql-x64-14 start=auto

production.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG TARGET="server"
77
################################################################################
88
# Build stage 1 - `yarn build`
99

10-
FROM node:16-alpine as builder
10+
FROM node:18-alpine as builder
1111
# Import our shared args
1212
ARG NODE_ENV
1313
ARG ROOT_URL
@@ -30,7 +30,7 @@ RUN yarn run build
3030
################################################################################
3131
# Build stage 2 - COPY the relevant things (multiple steps)
3232

33-
FROM node:16-alpine as clean
33+
FROM node:18-alpine as clean
3434
# Import our shared args
3535
ARG NODE_ENV
3636
ARG ROOT_URL
@@ -67,7 +67,7 @@ RUN rm -Rf /app/node_modules /app/@app/*/node_modules
6767
################################################################################
6868
# Build stage FINAL - COPY everything, once, and then do a clean `yarn install`
6969

70-
FROM node:16-alpine
70+
FROM node:18-alpine
7171

7272
EXPOSE $PORT
7373
WORKDIR /app/

scripts/lib/run.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const runSync = (cmd, args, options = {}) => {
44
const result = spawnSync(cmd, args, {
55
stdio: ["inherit", "inherit", "inherit"],
66
windowsHide: true,
7+
shell: process.platform === "win32",
78
...options,
89
env: {
910
...process.env,

0 commit comments

Comments
 (0)