Skip to content

Commit

Permalink
changed docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Oct 20, 2023
1 parent 0d3be60 commit 9cc7509
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build-latest-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.15.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand All @@ -226,8 +223,6 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: npm install
- run: npm run bundle
- name: Build v2-latest docker image
run: docker build . --file Dockerfile --tag pk910/powfaucet:v2-latest
- name: Push v2-latest docker image
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release-v2-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.15.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand All @@ -25,8 +22,6 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: npm install
- run: npm run bundle
- name: Get project versions
run: |
echo "server_version=$(cat package.json | jq ".version" | tr -d '"\r\n')" >> $GITHUB_OUTPUT
Expand Down
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# build env
FROM node:18-slim AS build-env
WORKDIR /build
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
RUN cd faucet-client && node ./build-client.js

# final stage
FROM node:18-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN update-ca-certificates
COPY dist ./dist
COPY static ./static
COPY faucet-config.example.yaml .
COPY --from=build-env /build/dist ./dist
COPY --from=build-env /build/static ./static
COPY --from=build-env /build/faucet-config.example.yaml .

EXPOSE 8080
ENTRYPOINT [ "node", "--no-deprecation", "dist/powfaucet.js" ]
ENTRYPOINT [ "node", "--no-deprecation", "dist/app.js" ]

0 comments on commit 9cc7509

Please sign in to comment.