Skip to content

Commit 249df13

Browse files
committed
build(node): update node version to lts/iron and update related dependancy
1 parent 03d3e8a commit 249df13

File tree

7 files changed

+4229
-19
lines changed

7 files changed

+4229
-19
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ jobs:
4242
run: |
4343
poetry install
4444
45-
- uses: actions/setup-node@v3
45+
- uses: actions/setup-node@v4
4646
with:
47-
node-version: 8
48-
49-
- name: Setup Yarn install
50-
uses: borales/actions-yarn@v4
51-
with:
52-
cmd: install
47+
node-version: '20.x'
48+
49+
- name: install via yarn2
50+
run: |
51+
yarn install --immutable
5352
5453
- name: Run ruff on src
5554
run: |

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/carbon
1+
lts/iron

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# [Node Stage to get node_modolues and node dependencies]
2-
FROM node:8.16.0-buster-slim as node_base
2+
FROM node:20.11.0-bullseye-slim as node_base
33
# [Python Stage for Django web server]
44
FROM python:3.10.14-slim-bullseye as python_base
55

66
FROM node_base as node_deps
77
COPY ./yarn.lock yarn.lock
88
COPY ./package.json package.json
99

10-
RUN apt-get update
11-
RUN apt-get install python-pip -y
12-
13-
RUN npm install -g yarn
14-
RUN yarn install --dev --frozen-lockfile && yarn cache clean
10+
RUN corepack enable
11+
RUN yarn install --immutable
1512

1613
FROM python_base as python_deps
1714
ENV APP_DIR /usr/local/app
1815

16+
# make nodejs accessible and executable globally
17+
ENV NODE_PATH $APP_DIR/node_modules/
18+
ENV PATH /usr/local/bin:$PATH
19+
20+
# Add bin directory used by `pip install --user`
21+
ENV PATH /home/docker/.local/bin:$PATH
22+
1923
# Infrastructure tools
2024
# gettext is used for django to compile .po to .mo files.
2125
RUN apt-get update

dev.Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# [Node Stage to get node_modolues and node dependencies]
2+
FROM node:20.11.0-bullseye as node_stage
3+
4+
COPY ./yarn.lock yarn.lock
5+
COPY ./package.json package.json
6+
7+
RUN corepack enable
8+
RUN yarn install --immutable
9+
10+
# [Python Stage for Django web server]
11+
FROM python:3.10.14-slim-bullseye as python_stage
12+
13+
WORKDIR /app
14+
15+
ENV PYTHONUNBUFFERED=1 \
16+
PYTHONDONTWRITEBYTECODE=1 \
17+
PIP_DISABLE_PIP_VERSION_CHECK=on \
18+
PIP_DEFAULT_TIMEOUT=100 \
19+
POETRY_HOME="/opt/poetry" \
20+
POETRY_VIRTUALENVS_IN_PROJECT=true \
21+
POETRY_NO_INTERACTION=1
22+
23+
# Infrastructure tools
24+
# gettext is used for django to compile .po to .mo files.
25+
RUN apt-get update
26+
RUN apt-get install -y \
27+
libpq-dev \
28+
gcc \
29+
zlib1g-dev \
30+
libjpeg62-turbo-dev \
31+
mime-support \
32+
gettext \
33+
libxml2-dev \
34+
libxslt-dev
35+
36+
# Install Poetry
37+
RUN pip install --no-cache-dir pip==23.3.2 && \
38+
pip install --no-cache-dir poetry==1.8.2
39+
40+
# Install Python dependencies
41+
COPY pyproject.toml poetry.lock ./
42+
RUN poetry install --no-root && \
43+
yes | poetry cache clear --all pypi
44+
45+
# Add poetry bin directory to PATH
46+
ENV PATH="${WORKDIR}/.venv/bin:$PATH"
47+
48+
COPY --from=node_stage /node_modules ./node_modules
49+
COPY --from=node_stage /usr/local/bin/node /usr/local/bin/node

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
"@babel/plugin-syntax-import-meta": "^7.10.4",
1313
"@babel/plugin-transform-class-properties": "^7.23.2",
1414
"@babel/preset-env": "^7.23.2",
15-
"autoprefixer": "^8.0.0",
15+
"autoprefixer": "^10.4.19",
1616
"babelify": "^10.0.0",
17-
"browserify": "^16.1.0",
18-
"node-sass": "^4.9.0",
19-
"postcss-cli": "^5.0.0"
17+
"browserify": "^17.0.0",
18+
"node-sass": "^9.0.0",
19+
"postcss": "^8.4.38",
20+
"postcss-cli": "^11.0.0"
2021
},
2122
"dependencies": {
2223
"blueimp-gallery": "^2.44.0",

src/pycontw2016/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def node_bin(name):
265265
COMPRESS_SCSS_COMPILER_CMD = (
266266
'{node_sass_bin} --include --output-style expanded {paths} '
267267
'--include-path="{node_modules}" "{infile}" "{outfile}" && '
268-
'{postcss_bin} --use "{node_modules}/autoprefixer" '
268+
'{postcss_bin} --use "{node_modules}/autoprefixer/lib/autoprefixer.js" '
269269
'--autoprefixer.browsers "{autoprefixer_browsers}" -r "{outfile}"'
270270
)
271271

0 commit comments

Comments
 (0)