diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b966f78a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: CI on Pull Request + +on: + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run tests + run: | + echo "Tesztelés" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..a102250f --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,39 @@ +name: Build and Push Alpine Docker Image + +on: + push: + branches: [ master ] + workflow_dispatch: + +env: + IMAGE_NAME: alpine-example + REGISTRY: docker.io + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKER_USERNAME }} + password: ${{ env.DOCKER_PASSWORD }} + registry: ${{ env.REGISTRY }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7a0ca9bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM python:3.8-alpine + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +RUN apk add --no-cache \ + gcc \ + musl-dev \ + python3-dev \ + libffi-dev \ + openssl-dev \ + make + +COPY requirements.txt . +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 8000 + +# Django indítás +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/home/settings/base.py b/home/settings/base.py index a2dd6687..0c6e97cd 100644 --- a/home/settings/base.py +++ b/home/settings/base.py @@ -3,7 +3,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) SECRET_KEY = '-05sgp9!deq=q1nltm@^^2cc+v29i(tyybv3v2t77qi66czazj' DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] INSTALLED_APPS = [ 'django.contrib.admin', diff --git a/home/settings/dev.py b/home/settings/dev.py index 2b3fec56..1e168acb 100644 --- a/home/settings/dev.py +++ b/home/settings/dev.py @@ -2,7 +2,7 @@ from .base import * -ALLOWED_HOSTS += ['127.0.0.1'] +ALLOWED_HOSTS += ['*'] DEBUG = True WSGI_APPLICATION = 'home.wsgi.dev.application' @@ -16,4 +16,4 @@ CORS_ORIGIN_WHITELIST = ( 'http://localhost:3000', -) \ No newline at end of file +) diff --git a/teszt b/teszt new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/teszt @@ -0,0 +1 @@ +test