Skip to content

Commit

Permalink
Merge pull request #3 from ConnActivity/docker
Browse files Browse the repository at this point in the history
feat: Added docker build
  • Loading branch information
Nereuxofficial authored Nov 27, 2023
2 parents 8c805ab + 0aab8d0 commit baa775e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python application

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

-
name: Build docker image without pushing it
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: false
tags: scraper:latest

9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.9-slim

COPY . /src

WORKDIR /src

RUN pip install -r requirements.txt

ENTRYPOINT ["python", "scraper.py"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@ services:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: movie_db
# Initialize the database using create_table.sql
volumes:
- ./create_table.sql:/docker-entrypoint-initdb.d/create_table.sql
restart: unless-stopped
scraper:
build: .
depends_on:
- db
environment:
DB_HOST: db
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: movie_db
restart: unless-stopped

0 comments on commit baa775e

Please sign in to comment.