Skip to content

Commit

Permalink
modify docker and github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
LuchoLeonel committed May 2, 2024
1 parent bddf6ea commit 461c120
Show file tree
Hide file tree
Showing 7 changed files with 2,942 additions and 71 deletions.
11 changes: 1 addition & 10 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
**/Thumbs.db
.github/
.editorconfig
**/node_modules/
email_bot/src/test_support/
credentials.json
tokencache.json
./vscode
Rocket.toml
**/.idea
latest_release
.git/
.idea/
public_api/static/certos/
private_api/templates/
.idea/
27 changes: 4 additions & 23 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build
env:
IMAGE_TAG_BACKEND: ghcr.io/werify-eu/vc-verifier/werify_client
IMAGE_TAG_CLIENT: ghcr.io/werify-eu/werify_client/werify_client

IMAGE_VERSION: ${{ github.ref == 'refs/heads/main' && 'latest' || 'staging' }}

Expand Down Expand Up @@ -33,8 +33,6 @@ jobs:
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: |
yarn.lock

- name: Docker Buildx Install
uses: docker/setup-buildx-action@v3
Expand All @@ -51,25 +49,8 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
target: build_werify_client
target: github
push: true
tags: ${{env.IMAGE_TAG_FRONTEND}}:${{env.IMAGE_VERSION}}
tags: ${{env.IMAGE_TAG_CLIENT}}:${{env.IMAGE_VERSION}}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Docker build image
uses: docker/build-push-action@v5
with:
context: .
target: build_werify_client
push: true
tags: ${{env.IMAGE_TAG_BACKEND}}:${{env.IMAGE_VERSION}}
cache-from: type=gha
cache-to: type=gha,mode=max

- uses: vishnudxb/[email protected]
if: failure()
with:
repo: WERIFY-EU/werify_client
workflow_id: ${{ github.run_id }}
access_token: ${{ github.token }}
cache-to: type=gha,mode=max
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Desktop.ini

# npm package lock file
package-lock.json
yarn.lock

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
Expand Down
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
FROM node:latest
FROM node:20 as base
LABEL com.centurylinklabs.watchtower.enable="true"

WORKDIR /usr/src/app

EXPOSE 3002

CMD ["node", "dist/server.js"]


FROM base as local

COPY package*.json ./

RUN yarn install
Expand All @@ -10,7 +18,13 @@ COPY . .

RUN yarn build

EXPOSE 3002
COPY src/public ./dist/public
COPY src/views ./dist/views


CMD ["node", "dist/bundle.js"]
FROM base as github

COPY node_modules ./
COPY dist ./dist/
COPY src/public ./dist/public
COPY src/views ./dist/views
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: '3'
services:
web:
build: .
build:
context: .
target: local
ports:
- "3002:3002"
environment:
Expand All @@ -12,7 +14,4 @@ services:
image: mongo
ports:
- "27017:27017"
volumes:
- ./mongod.conf:/etc/mongod.conf
- ./mongod.conf.orig:/etc/mongod.conf.orig
restart: always
30 changes: 0 additions & 30 deletions mongod.conf.orig

This file was deleted.

Loading

0 comments on commit 461c120

Please sign in to comment.