Skip to content

Commit

Permalink
multi stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
matt8707 committed Aug 19, 2022
1 parent 8ac4a2f commit 2507901
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
config
.DS_Store
*.code-workspace
*.code-workspace
docker-compose.yml
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM python:3.10-slim

COPY requirements.txt .
RUN pip install -r requirements.txt && mkdir /config
FROM python:3.10-slim AS build

WORKDIR /youtube-watching
COPY ./app ./app
RUN pip install -r ./app/requirements.txt


FROM python:3.10-alpine

WORKDIR /youtube-watching
COPY --from=build /youtube-watching .
COPY --from=build /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages
EXPOSE 5678

CMD ["python", "./app/main.py"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
volumes:
- /volume1/docker/youtube-watching/config:/config/
environment:
- COOKIE=/config/youtube.com_cookies.txt
- COOKIE=./config/youtube.com_cookies.txt
network_mode: bridge
ports:
- 5678:5678
Expand All @@ -70,7 +70,7 @@ services:
volumes:
- /volume1/docker/youtube-watching/config:/config/
environment:
- COOKIE=/config/youtube.com_cookies.txt
- COOKIE=./config/youtube.com_cookies.txt
network_mode: bridge
ports:
- 5678:5678
Expand Down
3 changes: 3 additions & 0 deletions app/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Flask==2.2.2
flask_restful==0.3.9
yt_dlp==2022.8.19

0 comments on commit 2507901

Please sign in to comment.