Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/onPush-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: OnPush master & upload dev image

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_ID }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: lomot/auto-checkin-uhr:latest
file: Dockerfile
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.7-slim

# config app
ENV APP_HOME="/app" \
APP_PATH="/app/server"

# install packages & config docker
RUN pip install matplotlib numpy selenium \
opencv-python undetected_chromedriver==3.0.3

RUN apt-get update && \
apt-get -y install wget chromium chromium-driver && \
apt-get -y autoremove && \
apt-get clean

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone

COPY ./* $APP_PATH/

WORKDIR ${APP_PATH}
CMD ["/usr/local/bin/python", "/app/server/main.py"]
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"

services:
uhr:
container_name: uhr
image: auto-checkin-uhr:latest
volumes:
- ./config.py:/app/server/config.py
restart: on-failure
stdin_open: true
tty: true