Skip to content

Commit

Permalink
Merge pull request #1 from AllenNeuralDynamics/foraging-main-copy
Browse files Browse the repository at this point in the history
adds script to publish docker image
  • Loading branch information
yosefmaru authored Mar 21, 2024
2 parents 307d662 + c198af6 commit 51ff5ba
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
.venv
venv
.streamlit/secrets.*
36 changes: 36 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tag and publish
on:
push:
branches:
- main
jobs:
tag:
uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main
secrets:
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }} # required

publish:
runs-on: ubuntu-latest
needs: tag
steps:
- uses: actions/checkout@v3
- name: Pull latest changes
run: git pull origin main
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v3
with:
# relative path to the place where source code with Dockerfile is located
context: .
push: true
tags: |
ghcr.io/allenneuraldynamics/foraging-behavior-browser-test:${{ needs.tag.outputs.new_version }}
ghcr.io/allenneuraldynamics/foraging-behavior-browser-test:latest
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ secrets*
curriculum_manager

.streamlit/secrets.toml
*.pyc
*.pyc
.venv
venv
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.8-slim

WORKDIR /app

COPY . .

RUN apt-get update
RUN apt-get install -y \
git \
build-essential \
curl \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install -r requirements.txt --no-cache-dir

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "code/Home.py", "--server.port=8501", "--server.address=0.0.0.0"]

0 comments on commit 51ff5ba

Please sign in to comment.