Skip to content

Commit

Permalink
init none working extraction from toloka2mediaserver
Browse files Browse the repository at this point in the history
  • Loading branch information
maksii committed Jun 3, 2024
1 parent 4cb0d78 commit 1da7f36
Show file tree
Hide file tree
Showing 17 changed files with 1,706 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docker_hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci

on:
push:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: maksii/toloka2mediaserver:latest
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ghostwriter
*.md.backup

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -106,10 +109,8 @@ ipython_config.py
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down Expand Up @@ -160,3 +161,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
/data/*
cookie.txt
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Web",
"type": "debugpy",
"request": "launch",
"module": "app",
}
]
}
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Use an official Python runtime as a parent image
FROM python:3

# Set the working directory in the container
WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the Python script and any other necessary files
COPY . .

# Add the config folder as a volume
VOLUME /app/toloka2MediaServer/data

# Define the default cron schedule
ENV CRON_SCHEDULE="0 8 * * *"

# Add the cron job to run toloka2transmission
ADD crontab /etc/cron.d/cron-job
RUN chmod 0644 /etc/cron.d/cron-job
RUN touch /var/log/cron.log

# Start cron service
CMD cron && tail -f /var/log/cron.log

# Make port available to the world outside this container
EXPOSE 5000

# Define environment variable
ENV PORT 5000

# Start-up script to run both cron and the web server
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
Loading

0 comments on commit 1da7f36

Please sign in to comment.