Skip to content

Commit

Permalink
fix(docker): fixed all docker scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakabuff committed Sep 17, 2023
1 parent 4b20c4c commit 2c5442d
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 20 deletions.
File renamed without changes.
2 changes: 0 additions & 2 deletions api/.dockerignore

This file was deleted.

13 changes: 7 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:

redarc:
build:
context: ./api
context: .
dockerfile: Dockerfile
image: redarc
container_name: redarc
Expand All @@ -59,6 +59,7 @@ services:

redis:
image: redis:7.0.12-alpine3.18
container_name: redis
networks:
- redarc
ports:
Expand All @@ -80,8 +81,8 @@ services:
env_file:
- .env
volumes:
- redarc_ingest_logs:/ingest/logs
- redarc_images:/ingest/gallery-dl
- redarc_ingest_logs:/image_downloader/logs
- redarc_images:/image_downloader/gallery-dl
depends_on:
redis:
condition: service_healthy
Expand All @@ -97,7 +98,7 @@ services:
env_file:
- .env
volumes:
- redarc_ingest_logs:/ingest/logs
- redarc_ingest_logs:/index_worker/logs
depends_on:
postgres:
condition: service_healthy
Expand All @@ -115,7 +116,7 @@ services:
env_file:
- .env
volumes:
- redarc_ingest_logs:/ingest/logs
- redarc_ingest_logs:/reddit_worker/logs
depends_on:
postgres:
condition: service_healthy
Expand All @@ -133,7 +134,7 @@ services:
env_file:
- .env
volumes:
- redarc_ingest_logs:/ingest/logs
- redarc_ingest_logs:/subreddit_worker/logs
depends_on:
redis:
condition: service_healthy
Expand Down
3 changes: 2 additions & 1 deletion ingest/image_downloader/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
logs
*.log
*.log
.env
4 changes: 2 additions & 2 deletions ingest/image_downloader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine3.18
FROM alpine:3.18

RUN apk update

Expand All @@ -12,4 +12,4 @@ RUN pip install rq
RUN pip install python-dotenv
RUN pip install gallery-dl

CMD ["/bin/python3", "image_downloader.py"]
CMD ["python3", "image_downloader.py"]
4 changes: 2 additions & 2 deletions ingest/index_worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine3.18
FROM alpine:3.18

RUN apk update

Expand All @@ -11,4 +11,4 @@ COPY . .
RUN pip install python-dotenv
RUN pip install psycopg2-binary

CMD ["/bin/python3", "index_worker.py"]
CMD ["python3", "index_worker.py"]
1 change: 1 addition & 0 deletions ingest/index_worker/index_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def index_db():
if not os.path.exists('logs'):
os.makedirs('logs')
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', filename='logs/index_worker-'+time_now+'.log', encoding='utf-8', level=logging.ERROR, datefmt='%Y-%m-%d %H:%M:%S')
logging.info("Starting index_worker")
try:
index_db()
while True:
Expand Down
3 changes: 2 additions & 1 deletion ingest/reddit_worker/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
logs
*.log
*.log
.env
4 changes: 2 additions & 2 deletions ingest/reddit_worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine3.18
FROM alpine:3.18

RUN apk update

Expand All @@ -13,4 +13,4 @@ RUN pip install python-dotenv
RUN pip install praw
RUN pip install psycopg2-binary

CMD ["/bin/python3", "reddit_worker.py"]
CMD ["python3", "reddit_worker.py"]
3 changes: 2 additions & 1 deletion ingest/subreddit_worker/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
logs
*.log
*.log
.env
5 changes: 2 additions & 3 deletions ingest/subreddit_worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine3.18
FROM alpine:3.18

RUN apk update

Expand All @@ -12,5 +12,4 @@ RUN pip install rq
RUN pip install python-dotenv
RUN pip install praw

RUN chmod +x entry.sh
CMD ["/bin/python3", "subreddit_worker"]
CMD ["python3", "subreddit_worker.py"]
1 change: 1 addition & 0 deletions ingest/subreddit_worker/subreddit_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def job_exists(id):
return False

if __name__ == "__main__":
logging.info("Starting subreddit_worker")
try:
while True:
work()
Expand Down

0 comments on commit 2c5442d

Please sign in to comment.