Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HelgeGehring committed Aug 2, 2023
2 parents bdac0de + e59a9b4 commit 1621fba
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ghcr.io/mamba-org/micromamba:latest

USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
gmsh \
&& rm -rf /var/lib/apt/lists/*
USER $MAMBA_USER

COPY --chmod=777 . ${HOME}

RUN micromamba install -y -n base -f environment.yml julia && micromamba clean --all --yes
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN pip install --no-cache notebook jupyterlab
RUN pip install .

RUN /bin/sh -c JULIA_PROJECT="" julia -e "using Pkg; Pkg.add(\"IJulia\"); using IJulia; installkernel(\"Julia\", \"--project=.\");" && julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); Pkg.resolve(); pkg"precompile"'
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
name: docker

on: push

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: .docker/Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/helgegehring/femwell@sha256:99ddc085fa52dd992a079b6a9126a35fe0a8819b94555f83806c5afde1507421
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: conda_env
channels:
- conda-forge
dependencies:
- python=3.10
- python
- pip
- slepc4py=*=complex*
- numpy
Expand All @@ -14,4 +14,3 @@ dependencies:
- meshio
- tqdm
- scikit-fem >=1.2.3
- git+https://github.com/HelgeGehring/femwell.git

0 comments on commit 1621fba

Please sign in to comment.