Skip to content

Commit

Permalink
Merge pull request #357 from datamade/update-node-script
Browse files Browse the repository at this point in the history
Update Node install script in Cookiecutter Dockerfiles
  • Loading branch information
smcalilly authored Jan 25, 2024
2 parents 687079a + 1904af7 commit 4a90e4a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions docker/templates/new-django-app/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"module_name": "my_new_app",
"run_command": "python manage.py runserver 0.0.0.0:8000",
"auto_migrate": true,
"node_version": 21,
"postgis": false,
"pg_version": "15",
"pg_db": "database"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ FROM python:3.11
# Give ourselves some credit
LABEL maintainer "DataMade <[email protected]>"

# Add the NodeSource PPA
# Add the NodeSource PPA and install Node.js
# (see: https://github.com/nodesource/distributions/blob/master/README.md)
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get update \
&& apt-get install sudo \
&& curl -fsSL https://deb.nodesource.com/setup_{{ cookiecutter.node_version }}.x | sudo -E bash - \
&& sudo apt-get install -y nodejs


# Install any additional OS-level packages you need via apt-get. RUN statements
# add additional layers to your image, increasing its final size. Keep your
Expand Down
3 changes: 2 additions & 1 deletion docker/templates/new-wagtail-app/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"app_name": "new-project",
"module_name": "project",
"app_verbose_name": "Site Name"
"app_verbose_name": "Site Name",
"node_version": 21
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
# version number in the pilot. YMMV. See this post for a discussion of
# some options and their pros and cons:
# https://pythonspeed.com/articles/base-image-python-docker-images/
FROM python:3.9
FROM python:3.11

# Give ourselves some credit
LABEL maintainer "DataMade <[email protected]>"

# Add the NodeSource PPA
# Add the NodeSource PPA and install Node.js
# (see: https://github.com/nodesource/distributions/blob/master/README.md)
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get update \
&& apt-get install sudo \
&& curl -fsSL https://deb.nodesource.com/setup_{{ cookiecutter.node_version }}.x | sudo -E bash - \
&& sudo apt-get install -y nodejs

# Install any additional OS-level packages you need via apt-get. RUN statements
# add additional layers to your image, increasing its final size. Keep your
Expand Down

0 comments on commit 4a90e4a

Please sign in to comment.