feat: pre-build artefact and dockerize (#7)

feat: pre-build artefact and dockerize
This commit is contained in:
Sasha 2023-11-06 00:45:46 +01:00 committed by GitHub
commit 6b298ba0c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 152 additions and 1524 deletions

View File

@ -11,17 +11,29 @@ jobs:
steps:
- id: commit
uses: pr-mpt/actions-commit-hash@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Setup node.js
uses: actions/setup-node@v3
- name: Setup npm
uses: bahmutov/npm-install@v1
- name: Artefact build
run: npm run build
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true

View File

@ -1,8 +1,4 @@
FROM node:18
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "run", "serve"]
FROM httpd:2.4
RUN mkdir -p /usr/local/apache2/htdocs/_next
COPY ./out/* /usr/local/apache2/htdocs/
COPY ./out/_next /usr/local/apache2/htdocs/_next

View File

@ -27,6 +27,7 @@ npm run serve
## To run in docker
```bash
npm run build
docker build -t waku_frontend .
docker run -d -p 300:3000 waku_frontend
```

1643
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"serve": "serve ./out"
"lint": "next lint"
},
"dependencies": {
"@waku/rln": "0.1.1-7e8cb89",
@ -29,7 +28,6 @@
"eslint": "^8",
"eslint-config-next": "13.5.6",
"postcss": "^8",
"serve": "^14.2.1",
"tailwindcss": "^3",
"typescript": "^5"
}