Skip to content

Commit

Permalink
add frontend to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Floris272 committed Jan 31, 2025
1 parent 634cc12 commit 9c1dd07
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
python-version: '3.11'
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'no'
setup-node: 'yes'
apt-packages: 'gettext'

- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
language: [ 'javascript', 'python' ]

steps:
- name: Checkout repository
Expand Down
44 changes: 22 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ COPY ./requirements /app/requirements
RUN pip install -r requirements/production.txt


# Stage 2 - Install frontend deps and build assets
#FROM node:20-bookworm-slim AS frontend-build
#
#RUN apt-get update && apt-get install -y --no-install-recommends \
# git \
# && rm -rf /var/lib/apt/lists/*
#
#WORKDIR /app
#
## copy configuration/build files
#COPY ./build /app/build/
#COPY ./*.json ./*.js ./.babelrc /app/
#
## install WITH dev tooling
#RUN npm ci
#
## copy source code
#COPY ./src /app/src
#
## build frontend
#RUN npm run build
Stage 2 - Install frontend deps and build assets
FROM node:20-bookworm-slim AS frontend-build

RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# copy configuration/build files
COPY ./build /app/build/
COPY ./*.json ./*.js ./.babelrc /app/

# install WITH dev tooling
RUN npm ci

# copy source code
COPY ./src /app/src

# build frontend
RUN npm run build


# Stage 3 - Build docker image suitable for production
Expand Down Expand Up @@ -80,7 +80,7 @@ COPY --from=backend-build /usr/local/bin/celery /usr/local/bin/celery
COPY --from=backend-build /app/src/ /app/src/

# copy frontend build statics
# COPY --from=frontend-build /app/src/open_producten/static /app/src/open_producten/static
COPY --from=frontend-build /app/src/open_producten/static /app/src/open_producten/static

# copy source code
COPY ./src /app/src
Expand Down

0 comments on commit 9c1dd07

Please sign in to comment.