forked from AllenNeuralDynamics/foraging-behavior-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from AllenNeuralDynamics/foraging-main-copy
adds script to publish docker image
- Loading branch information
Showing
4 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,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.* |
This file contains 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,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 |
This file contains 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 |
---|---|---|
|
@@ -6,4 +6,6 @@ secrets* | |
curriculum_manager | ||
|
||
.streamlit/secrets.toml | ||
*.pyc | ||
*.pyc | ||
.venv | ||
venv |
This file contains 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,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"] |