-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sage-monorepo): add GH workflow to link Dockerfile (#2573)
- Loading branch information
1 parent
8ec36d3
commit 122c79d
Showing
6 changed files
with
84 additions
and
40 deletions.
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,26 @@ | ||
name: Lint Dockerfiles | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'agora/**' | ||
- 'iatlas/**' | ||
- 'openchallenges/**' | ||
- 'sage-monorepo/**' | ||
- 'schematic/**' | ||
pull_request: | ||
|
||
jobs: | ||
hadolint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Lint Dockerfiles | ||
uses: hadolint/hadolint-action@v3.1.0 | ||
with: | ||
recursive: true |
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,9 @@ | ||
ignored: | ||
# Pin versions in apt-get install. | ||
# Reason: Identifying the versions of apt packages is not trivial. The versions available would | ||
# also differ for different base images. This decision should be re-evaluated periodically. | ||
- DL3008 | ||
# Pin versions in apt get install. | ||
# Reason: Identifying the versions of apk packages is not trivial. The versions available would | ||
# also differ for different base images. This decision should be re-evaluated periodically. | ||
- DL3018 |
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 |
---|---|---|
@@ -1,26 +1,33 @@ | ||
FROM python:3.10.13 | ||
|
||
RUN apt-get -y update && apt-get -y install \ | ||
wget && \ | ||
# Install the GPG key for the Postgres repo | ||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ | ||
# Add the repo | ||
echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \ | ||
apt-get -y update && \ | ||
# Install the Postgres 12 client | ||
apt-get -y install postgresql-client-12 && \ | ||
mkdir -p /home/gitlab/sage-iatlas-data | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
RUN apt-get update -qq -y && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get install --no-install-recommends -qq -y \ | ||
wget \ | ||
# Install the GPG key for the Postgres repo | ||
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | ||
# Add the repo | ||
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ | ||
&& apt-get update -qq -y \ | ||
# Install the Postgres 12 client | ||
&& apt-get install --no-install-recommends -qq -y \ | ||
postgresql-client-12 \ | ||
&& mkdir -p /home/gitlab/sage-iatlas-data \ | ||
&& apt-get -y autoclean \ | ||
&& apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR / | ||
COPY requirements.txt requirements.txt | ||
COPY src/ /src | ||
|
||
RUN pip3 install -r requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
WORKDIR / | ||
COPY docker-entrypoint.sh ./ | ||
RUN chmod +x docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
# Set up the iAtlas database | ||
CMD python /src/build_database.py | ||
CMD ["python", "/src/build_database.py"] |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM vault:1.12.7 | ||
|
||
RUN apk add curl jq | ||
RUN apk add --no-cache curl jq | ||
|
||
HEALTHCHECK --interval=2s --timeout=3s --retries=20 --start-period=5s \ | ||
CMD curl --fail --silent "localhost:${SERVER_PORT}/v1/sys/health" | jq '.initialized' | grep true || exit 1 |
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