Skip to content

Commit

Permalink
merging the node dependencies in the service docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
HesamKorki committed Sep 20, 2023
1 parent 4f68540 commit 4da7cee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Docker Image CI
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

env:
REGISTRY: ghcr.io
Expand Down
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.9.6-slim
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code/log /static \
&& apt-get update \
&& apt-get install -yq libsasl2-dev python-dev libldap2-dev git libssl-dev build-essential \
&& apt-get install -yq libsasl2-dev python-dev libldap2-dev git libssl-dev build-essential wget \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /code

Expand All @@ -14,3 +14,17 @@ RUN pip install --no-cache-dir -e . 2>/dev/null || true
COPY . /code/
# ... and this will be blazing fast
RUN pip install --no-cache-dir -e .

# Install node
RUN apt-get update \
&& apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update \
&& apt-get install -y nodejs

# Install npm dependencies
RUN cd /code/web/static/vendor \
&& npm ci \
&& npm run-script build

0 comments on commit 4da7cee

Please sign in to comment.