-
Notifications
You must be signed in to change notification settings - Fork 218
feat(docker): add minimal support (ai implementation) #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rcmorano
wants to merge
1
commit into
hfaran:master
Choose a base branch
from
rcmorano:feat/add-docker-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Poetry (except pyproject.toml and poetry.lock) | ||
| .poetry | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| # Virtual environments | ||
| venv/ | ||
| env/ | ||
| ENV/ | ||
| .venv | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Testing | ||
| .pytest/ | ||
| .coverage | ||
| htmlcov/ | ||
| .tox/ | ||
| .mypy_cache/ | ||
|
|
||
| # Documentation (except README.md) | ||
| *.md | ||
| !README.md # Keep README for documentation | ||
|
|
||
| # Build artifacts | ||
| dist/ | ||
| build/ | ||
| *.whl | ||
|
|
||
| # Slack export (if accidentally included) | ||
| *.zip | ||
| !docker-compose.yml # docker-compose stays | ||
|
|
||
| # Misc | ||
| .git/ | ||
| .gitignore | ||
| .gitattributes | ||
| *.log | ||
| .env | ||
| .env.local | ||
| .DS_Store | ||
| Thumbs.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,4 +69,6 @@ target/ | |
| .vscode | ||
|
|
||
| # Environments | ||
| venv/ | ||
| venv/ | ||
|
|
||
| slack-export.zip | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # syntax=docker/dockerfile:1.4 | ||
|
|
||
| # Build stage | ||
| FROM python:3.12-slim as builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install dependencies via pip (simpler for Docker) | ||
| COPY pyproject.toml poetry.lock ./ | ||
| RUN pip install --no-cache-dir click werkzeug flask markdown2 emoji frozen-flask | ||
|
|
||
| # Runtime stage | ||
| FROM python:3.12-slim as runtime | ||
|
|
||
| # Install curl for healthcheck (optional) | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get purge -y --auto-remove | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy dependencies from builder to ensure they're available in the runtime image | ||
| COPY --from=builder /usr/local/lib/python3.12/site-packages/ /usr/local/lib/python3.12/site-packages/ | ||
| COPY --from=builder /usr/local/bin/ /usr/local/bin/ | ||
|
|
||
| # Copy application code | ||
| COPY . . | ||
|
|
||
| # Create user with UID/GID matching host for file permissions | ||
| RUN groupadd -g 1000 app && useradd -u 1000 -g app -m app | ||
|
|
||
| # Switch to non-root user | ||
| USER app | ||
|
|
||
| # Expose default port | ||
| EXPOSE 5000 | ||
|
|
||
| # Health check (optional) | ||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | ||
| CMD curl -f http://localhost:5000/ || exit 1 | ||
|
|
||
| # Default command - can be overridden | ||
| CMD ["python", "app.py", "--help"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| services: | ||
| slack-export-viewer: | ||
| build: | ||
| dockerfile: Dockerfile | ||
| target: runtime | ||
| image: slack-export-viewer:latest | ||
| container_name: slack-export-viewer | ||
| ports: | ||
| - "5000:5000" | ||
| volumes: | ||
| # Mount your Slack export archive directory/zip | ||
| - type: bind | ||
| source: ./slack-export.zip # CHANGE THIS to your archive path | ||
| target: /app/slack-export.zip | ||
| read_only: true | ||
| # Optional: persist cache or output directory | ||
| - slack-data:/app/.cache/slackviewer | ||
| environment: | ||
| - SEV_ARCHIVE=/app/slack-export.zip | ||
| - SEV_PORT=5000 | ||
| - SEV_IP=0.0.0.0 | ||
| - SEV_NO_BROWSER=true | ||
| # Optional configuration: | ||
| # - SEV_CHANNELS=general,random | ||
| # - SEV_HTML_ONLY=false | ||
| # - SEV_DEBUG=true | ||
| # - SEV_SHOW_DMS=false | ||
| # - SEV_NO_SIDEBAR=false | ||
| command: > | ||
| python app.py | ||
| --archive /app/slack-export.zip | ||
| --port 5000 | ||
| --ip 0.0.0.0 | ||
| --no-browser | ||
|
|
||
| volumes: | ||
| slack-data: |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems prone to breaking over time. Is there no better way to install the dependencies properly?