Skip to content

Commit

Permalink
chore(package): use pnpm as manager
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Dec 10, 2024
1 parent c97177b commit cfe57b9
Show file tree
Hide file tree
Showing 7 changed files with 3,295 additions and 5,331 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- alpha
- beta
- master
- main
- renovate/**

jobs:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build project
run: npm run build
run: pnpm run build

- name: Upload production-ready build files
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
npm run lint
# npm test
pnpm run lint
# pnpm test
32 changes: 11 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

FROM node:22.12.0-alpine AS base-image

# # The `CI` environment variable must be set for pnpm to run in headless mode
# ENV CI=true
# The `CI` environment variable must be set for pnpm to run in headless mode
ENV CI=true

WORKDIR /srv/app/

Expand All @@ -20,14 +20,13 @@ FROM base-image AS development

# COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh

# VOLUME /srv/.pnpm-store
VOLUME /srv/.pnpm-store
VOLUME /srv/app

USER node

# ENTRYPOINT ["docker-entrypoint.sh"]
# CMD ["pnpm", "run", "--dir", "src", "dev", "--host"]
CMD ["npm", "run", "dev", "--port", "3000"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["pnpm", "run", "dev", "--host", "--port", "3000"]
EXPOSE 3000

# HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost:3000/api/healthcheck || exit 1
Expand All @@ -38,15 +37,13 @@ EXPOSE 3000

FROM base-image AS prepare

# COPY ./pnpm-lock.yaml ./
COPY ./package.json ./package-lock.json ./
COPY ./pnpm-lock.yaml ./

# RUN pnpm fetch
RUN npm install
RUN pnpm fetch

COPY ./ ./

# RUN pnpm install --offline
RUN pnpm install --offline


# ########################
Expand All @@ -60,8 +57,7 @@ COPY ./ ./
# # ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}

# ENV NODE_ENV=production
# RUN npm run build
# # RUN pnpm --dir src run build:node
# RUN pnpm run build:node


########################
Expand All @@ -73,17 +69,15 @@ FROM prepare AS build-static
# ENV SITE_URL=${SITE_URL}

ENV NODE_ENV=production
RUN npm run build
# RUN pnpm --dir src run build:static
RUN pnpm run build:static


########################
# Nuxt: lint

FROM prepare AS lint

RUN npm run lint
# RUN pnpm -r run lint
RUN pnpm run lint


# ########################
Expand Down Expand Up @@ -192,10 +186,6 @@ COPY --from=lint /srv/app/package.json /tmp/package.json

FROM nginx:1.27.3-alpine AS production

# The `CI` environment variable must be set for pnpm to run in headless mode
ENV CI=true
ENV NODE_ENV=production

WORKDIR /usr/share/nginx/html

# COPY ./docker/nginx.conf /etc/nginx/nginx.conf
Expand Down
Loading

0 comments on commit cfe57b9

Please sign in to comment.