Browse Source

Github action

pull/71/head
Per-Arne Andersen 4 years ago
parent
commit
97f44f81da
  1. 25
      .github/workflows/image.yml
  2. 3
      .travis.yml
  3. 54
      Dockerfile

25
.github/workflows/image.yml

@ -0,0 +1,25 @@
name: build wg-dashboard
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image
run: |
docker buildx build --push \
--tag perara/wg-manager:latest \
--platform linux/amd64,linux/arm64/v8,linux/arm64,linux/arm/v7,linux/arm/v6 .

3
.travis.yml

@ -1,5 +1,6 @@
dist: focal
sudo: required
os: linux
language: python
env:
global:
- DOCKER_REPO=perara/wg-manager

54
Dockerfile

@ -1,27 +1,53 @@
FROM node:14-alpine
FROM ubuntu:20.04
ENV TZ=Europe/Minsk
ENV DEBIAN_FRONTEND=noninteractive
COPY ./wg_dashboard_frontend /tmp/build
WORKDIR /tmp/build
RUN apk add --no-cache build-base python3-dev && \
npm cache clean --force && npm install && npm install -g @angular/cli && \
ng build --configuration="production" && \
rm -rf node_modules && \
apk del build-base python3-dev
FROM alpine:3.12
RUN apt-get update && apt-get install -y \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
RUN npm cache clean --force
RUN npm install
RUN npm install @angular/cli
RUN node_modules/@angular/cli/bin/ng build --configuration="production"
RUN rm -rf node_modules
RUN apt-get purge nodejs npm -y
FROM ubuntu:20.04
LABEL maintainer="per@sysx.no"
ENV IS_DOCKER True
WORKDIR /app
ENV LIBRARY_PATH=/lib:/usr/lib
ENV TZ=Europe/Oslo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY wg_dashboard_backend /app
# Install dependencies
RUN apk add --no-cache --update wireguard-tools py3-gunicorn python3 py3-pip ip6tables
#RUN apk add --no-cache --update wireguard-tools py3-gunicorn python3 py3-pip ip6tables
RUN apt-get update && apt-get install -y \
wireguard-tools \
iptables \
python3 \
python3-pip \
python3-dev \
python3-gunicorn \
python3-uvicorn \
gunicorn \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install -r requirements.txt
COPY wg_dashboard_backend /app
ENV LIBRARY_PATH=/lib:/usr/lib
# Install dependencies
RUN apk add --no-cache build-base python3-dev libffi-dev jpeg-dev zlib-dev && \
pip3 install uvicorn && \
pip3 install -r requirements.txt && \
apk del build-base python3-dev libffi-dev jpeg-dev zlib-dev
#RUN apk add --no-cache build-base python3-dev libffi-dev jpeg-dev zlib-dev && \
#pip3 install uvicorn && \
#pip3 install -r requirements.txt && \
#apk del build-base python3-dev libffi-dev jpeg-dev zlib-dev
# Copy startup scripts
COPY docker/ ./startup

Loading…
Cancel
Save