Skip to content

Commit

Permalink
Add dockerfile and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannonlynne committed Sep 12, 2024
1 parent 273d9b0 commit 7135016
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docker Build

"on":
# Modify workflow to run on tag, when update dockerfile
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-latest

# (optional) only build on tags or ticket branches
if: >
startsWith(github.ref, 'refs/tags/')
|| startsWith(github.head_ref, 'tickets/')
steps:
- uses: actions/checkout@v4

- uses: lsst-sqre/build-and-push-to-ghcr@v1
id: build
with:
image: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- run: echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }}
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Follow https://micromamba-docker.readthedocs.io/en/latest/

# Base container
FROM mambaorg/micromamba:1.5.9

# Add rubin-sim from conda-forge

RUN micromamba install -y -n base -c conda-forge rubin-sim
RUN micromamba install -y -n base -c conda-forge \
jinja2 \
tornado
RUN micromamba clean --all --yes
ARG MAMBA_DOCKERFILE_ACTIVATE=1

# Container execution
# Mount fbs simulation outputs expected at /data/fbs_sims

EXPOSE 8080
ENV PORT 8080

# Start up show_maf on port 8080
CMD cd /data/fbs_sims && show_maf -p 80 --no_browser

0 comments on commit 7135016

Please sign in to comment.