Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vncloudsco authored Dec 14, 2023
1 parent fd5a5e5 commit 90ce8fe
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 14 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker Build and Push

on:
push:
branches:
- main

jobs:
build_and_push:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

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

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


- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin


- name: Build and Push Docker Image for rengine
run: |
docker buildx create --use
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
docker buildx build --platform linux/amd64,linux/arm64 -t vouu/rengine ./web --push
58 changes: 44 additions & 14 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Base image
FROM --platform=linux/amd64 ubuntu:22.04
FROM ubuntu:22.04

ARG version=0.33.0
ARG geckodriver_amd=geckodriver-v${version}-linux64.tar.gz
ARG geckodriver_arm=geckodriver-v${version}-linux-aarch64.tar.gz

ARG go_version=1.21.5
ARG go_amd=go${go_version}.linux-amd64.tar.gz
ARG go_arm=go${go_version}.linux-arm64.tar.gz

ARG ARCH=$(dpkg --print-architecture)

# Labels and Credits
LABEL \
Expand All @@ -18,11 +28,10 @@ ENV PATH="${PATH}:${GOROOT}/bin:${GOPATH}/bin"

# Install Python
RUN apt update -y && \
apt update -y && \
apt install -y \
python3.10 \
python3-dev \
python3-pip
python3-pip

# Install essential packages
RUN apt install -y --no-install-recommends \
Expand All @@ -47,17 +56,38 @@ RUN apt install -y --no-install-recommends \

RUN add-apt-repository ppa:mozillateam/ppa

# Download and install go 1.20
RUN wget https://golang.org/dl/go1.21.4.linux-amd64.tar.gz
RUN tar -xvf go1.21.4.linux-amd64.tar.gz
RUN rm go1.21.4.linux-amd64.tar.gz
RUN mv go /usr/local

# Download geckodriver
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz
RUN tar -xvf geckodriver-v0.32.0-linux64.tar.gz
RUN rm geckodriver-v0.32.0-linux64.tar.gz
RUN mv geckodriver /usr/bin
RUN if [ "${ARCH}" = "arm64" ]; then \
wget https://go.dev/dl/${go_arm} \
&& tar -xvf ${go_arm} \
&& rm ${go_arm} \
&& mv go /usr/local; \
elif [ "${ARCH}" = "amd64" ]; then \
wget https://go.dev/dl/${go_amd} \
&& tar -xvf ${go_amd} \
&& rm ${go_amd} \
&& mv go /usr/local; \
else \
echo "Unknown architecture: $ARCH" ; \
exit 1; \
fi



RUN if [ "${ARCH}" = "arm64" ]; then \
wget https://github.com/mozilla/geckodriver/releases/download/v${version}/${geckodriver_arm} \
&& tar -xvf ${geckodriver_arm} \
&& rm ${geckodriver_arm} \
&& mv geckodriver /usr/bin; \
elif [ "${ARCH}" = "amd64" ]; then \
wget https://github.com/mozilla/geckodriver/releases/download/v${version}/${geckodriver_amd} \
&& tar -xvf ${geckodriver_amd} \
&& rm ${geckodriver_amd} \
&& mv geckodriver /usr/bin; \
else \
echo "Unknown architecture: $ARCH" ; \
exit 1; \
fi


# Make directory for app
WORKDIR /usr/src/app
Expand Down

0 comments on commit 90ce8fe

Please sign in to comment.