Skip to content

Commit

Permalink
Merge pull request #41 from kevinfarrugia/main
Browse files Browse the repository at this point in the history
Update GitHub action to publish to multiple architectures
  • Loading branch information
ousamabenyounes authored Feb 29, 2024
2 parents fa95412 + d547b53 commit 0a9b57f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,30 @@ jobs:
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_REPOSITORY }}


- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push the Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:18-alpine
FROM node:18-alpine

ENV VERSION=develop
ENV VERSION=main

WORKDIR /usr/src/ylt

RUN apk upgrade --update && apk --no-cache add git gcc make g++ zlib-dev libjpeg-turbo-dev nasm automake autoconf libtool \
&& git clone https://github.com/YellowLabTools/YellowLabTools-server.git -b ${VERSION} . \
&& NODE_ENV=development && npm install jpegoptim-bin --unsafe-perm=true --allow-root --legacy-peer-deps --omit=dev \
&& NODE_ENV=production && export CPPFLAGS="-DPNG_ARM_NEON_OPT=0" && npm install --unsafe-perm=true --allow-root --legacy-peer-deps --omit=dev \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
Expand Down
39 changes: 30 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,52 @@
# The official Yellow Lab Tools v3 image
[`Yellow Lab Tools`](https://github.com/YellowLabTools/YellowLabTools) is an open source project developed by Gaël Métais.

[`Yellow Lab Tools`](https://github.com/YellowLabTools/YellowLabTools) is an open-source project developed by Gaël Métais.

It analyzes a webpage and detects **performance** or **front-end code quality** issues. Free, easy to launch, easy to understand, in-depth details. With this docker image, you can run your own YellowLabTools instance.

This image will be updated continuously.

## Usage

# Usage
```
```sh
docker run --privileged -p 8383:8383 ousamabenyounes/yellowlabtools
```
or if you prefer to run it in detached mode adding -d option

```
or if you prefer to run it in detached mode add the `-d` option:

```sh
docker run -d --privileged -p 8383:8383 ousamabenyounes/yellowlabtools
```

And then open [`http://localhost:8383/`](http://localhost:8383/) on your web browser.

## Debug

If you need to run your instance in Debug mode
If you need to run your instance in debug mode, add `'DEBUG=*` to the environment variables:

```
```sh
docker run --privileged --env 'DEBUG=*' -p 8383:8383 ousamabenyounes/yellowlabtools
```

To test your local server on your computer you have to do this:
## Development

replace http://localhost:8080/ by http://host.docker.internal:8080/
You can connect to your fork of YellowLabTools by changing the GitHub repository in the `Dockerfile` and rebuilding the image.

**Dockerfile:**
```diff
- && git clone https://github.com/YellowLabTools/YellowLabTools-server.git -b ${VERSION} . \
+ && git clone https://github.com/kevinfarrugia/YellowLabTools-server.git -b ${VERSION} . \
```

**Build:**
```sh
docker build -t yellowlabtools .
```

**Run:**
```sh
docker run --privileged -p 8383:8383 yellowlabtools
```

# Contributors
- Gaël Métais [gmetais](https://github.com/gmetais)
Expand Down

0 comments on commit 0a9b57f

Please sign in to comment.