Skip to content

Commit

Permalink
Change runtime from nginx to npm preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ins1d3r committed Jul 17, 2024
1 parent 47d7523 commit 3897fdf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
node_modules
.github/
Dockerfile
13 changes: 0 additions & 13 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Build static content
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
image: ghcr.io/wirenboard/website-base-image:initial
options: -v ${{ github.workspace }}:/var/www
run: |
cd /var/www
pnpm install
pnpm run build
- name: Build and push
uses: docker/build-push-action@v5
with:
Expand Down
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
FROM nginx
FROM ghcr.io/wirenboard/website-base-image:initial

# Not really useful outside GitHub Actions - actual builds happens there,
# Dockerfile just copies the output to various flavors of Nginx image
WORKDIR /var/www

COPY .output/public/ /usr/share/nginx/html/
COPY package.json /var/www
RUN pnpm install

COPY . /var/www
RUN pnpm run build

ENV PORT=80

ENTRYPOINT ["/usr/bin/node", "/var/www/.output/server/index.mjs"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"preview": "nuxt preview --port=80",
"postinstall": "nuxt prepare"
},
"dependencies": {
Expand Down

0 comments on commit 3897fdf

Please sign in to comment.