Skip to content

Commit

Permalink
Merge pull request #62 from HugoRCD/fix/55
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoRCD authored Dec 30, 2024
2 parents 3efea3a + ce7b7a9 commit c9be8ec
Show file tree
Hide file tree
Showing 11 changed files with 12,555 additions and 36 deletions.
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Versioning
.git
.gitignore
.github

# Dependencies
**/node_modules
**/dist
**/.next
**/.nuxt
**/.output

# Dev files
.env*
.editorconfig

# CI/CD
.gitlab-ci.yml
.circleci
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false

- name: 📦 Install dependencies
run: bun install
run: pnpm install --frozen-lockfile

- name: 🛠️ Build
run: bun run build
run: pnpm run build
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=true
auto-install-peers=true
ignore-workspace-root-check=true
29 changes: 9 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
# Stage 1: Build Stage
FROM oven/bun:latest AS build
FROM node:20-alpine AS build

RUN apk add --no-cache python3 make g++ \
&& corepack enable \
&& corepack prepare pnpm@latest --activate

ARG TURBO_TEAM
ARG TURBO_TOKEN

Check warning on line 9 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "TURBO_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG NUXT_PRIVATE_GITHUB_TOKEN
ARG NUXT_PUBLIC_STUDIO_TOKENS
ARG NUXT_PUBLIC_SITE_URL
ARG NUXT_PUBLIC_MEETING_LINK
ARG NUXT_PRIVATE_RESEND_API_KEY
ARG NUXT_PRIVATE_NOTES_PASSWORD

ENV TURBO_TEAM=$TURBO_TEAM
ENV TURBO_TOKEN=$TURBO_TOKEN

Check warning on line 12 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TURBO_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV NUXT_PRIVATE_GITHUB_TOKEN=$NUXT_PRIVATE_GITHUB_TOKEN
ENV NUXT_PUBLIC_STUDIO_TOKENS=$NUXT_PUBLIC_STUDIO_TOKENS
ENV NUXT_PUBLIC_SITE_URL=$NUXT_PUBLIC_SITE_URL
ENV NUXT_PUBLIC_MEETING_LINK=$NUXT_PUBLIC_MEETING_LINK
ENV NUXT_PRIVATE_RESEND_API_KEY=$NUXT_PRIVATE_RESEND_API_KEY
ENV NUXT_PRIVATE_NOTES_PASSWORD=$NUXT_PRIVATE_NOTES_PASSWORD
ENV NODE_ENV=production

WORKDIR /app

COPY package.json ./
COPY bun.lockb ./

COPY . .

RUN bun install

RUN bun run build
RUN pnpm install --frozen-lockfile --prod
RUN pnpm run build

# Stage 2: Final Stage
FROM oven/bun:latest
FROM node:20-alpine AS final

WORKDIR /app

COPY --from=build /app/.output .output

EXPOSE 3000

CMD ["bun", "run", ".output/server/index.mjs"]
CMD ["node", ".output/server/index.mjs"]
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ git clone git@github.com:HugoRCD/hr-folio.git

2. Install dependencies
```bash
bun install
pnpm install
```

3. Start development server
```bash
bun dev
pnpm dev
```

4. Generate static project
```bash
bun generate
pnpm generate
```

5. Start production server
```bash
bun start
pnpm start
```

## How to Modify the Portfolio Content
Expand Down Expand Up @@ -105,7 +105,7 @@ To start contributing, you can follow these steps:
3. Create a branch using conventional commits and the issue number as the branch name. For example, `feat/123` or `fix/456`.
4. Make changes following the local development steps.
5. Commit your changes following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
6. If your changes affect the code, run tests using `bun run test`.
6. If your changes affect the code, run tests using `pnpm run test`.
7. Create a pull request following the [Pull Request Template](https://github.com/HugoRCD/markdown/blob/main/src/pull_request_template.md).
- To be merged, the pull request must pass the tests/workflow and have at least one approval.
- If your changes affect the documentation, make sure to update it.
Expand All @@ -123,8 +123,8 @@ To start contributing, you can follow these steps:
- Clone this repository
- Install latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `bun install`
- Start development server using `bun dev`
- Install dependencies using `pnpm install`
- Start development server using `pnpm dev`
- Open [http://localhost:3000](http://localhost:3000) in your browser

</details>
Expand Down
Binary file removed bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion docker-compose.coolify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ services:
container_name: hr_folio
restart: always
environment:
- NUXT_PUBLIC_SITE_URL=${SERVICE_FQDN_FOLIO_3000}
- NUXT_PRIVATE_RESEND_API_KEY=${NUXT_PRIVATE_RESEND_API_KEY}
- NUXT_PRIVATE_NOTES_PASSWORD=${NUXT_PRIVATE_NOTES_PASSWORD}
- NUXT_PRIVATE_GITHUB_TOKEN=${NUXT_PRIVATE_GITHUB_TOKEN}
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
services:
hr_folio:
build:
context: ./
dockerfile: ./Dockerfile
context: .
dockerfile: Dockerfile
container_name: hr_folio
restart: always
environment:
- NUXT_PUBLIC_SITE_URL=${NUXT_PUBLIC_SITE_URL:-http://localhost:3000}
- NUXT_PRIVATE_RESEND_API_KEY=${NUXT_PRIVATE_RESEND_API_KEY}
- NUXT_PRIVATE_NOTES_PASSWORD=${NUXT_PRIVATE_NOTES_PASSWORD}
- NUXT_PRIVATE_GITHUB_TOKEN=${NUXT_PRIVATE_GITHUB_TOKEN}
Expand Down
1 change: 0 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default defineNuxtConfig({
},

nitro: {
preset: process.env.NITRO_PRESET || 'bun',
prerender: {
crawlLinks: true,
routes: ['/', '/works', '/about', '/writing'],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"start": "node .output/server/index.mjs",
"local:studio": "npx nuxt dev --tunnel",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"packageManager": "pnpm@9.14.2",
"dependencies": {
"@nuxt/content": "3.0.0-alpha.8",
"@nuxt/image": "1.8.1",
"@nuxt/scripts": "0.9.5",
"@vueuse/nuxt": "12.0.0",
"mockline": "0.14.0",
"nuxt": "3.14.1592",
"pg": "^8.13.1",
"resend": "4.0.1",
"vue": "3.5.13",
"vue-router": "4.5.0"
Expand Down
Loading

0 comments on commit c9be8ec

Please sign in to comment.