-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 'docker compose' to run tests and linters
- Loading branch information
Igor Sudak
committed
Apr 3, 2024
1 parent
2858e6c
commit c8f3b78
Showing
13 changed files
with
224 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,25 +1,17 @@ | ||
FROM almalinux:8 | ||
|
||
RUN dnf install -y epel-release && \ | ||
dnf upgrade -y && \ | ||
dnf install -y --enablerepo="powertools" --enablerepo="epel" \ | ||
python39 python39-devel python3-virtualenv python39-setuptools pinentry gnupg2 && \ | ||
dnf clean all | ||
|
||
|
||
RUN groupadd -g 1000 alt && \ | ||
useradd -ms /bin/bash -u 1000 -g 1000 alt && \ | ||
usermod -aG wheel alt && \ | ||
echo 'alt ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ | ||
echo 'wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
FROM almalinux:9 | ||
|
||
RUN <<EOT | ||
set -ex | ||
dnf upgrade -y | ||
dnf install -y pinentry | ||
dnf clean all | ||
EOT | ||
|
||
WORKDIR /app | ||
RUN virtualenv -p python3.9 env | ||
COPY setup.py /app | ||
RUN /app/env/bin/pip install -e /app/. | ||
|
||
RUN chown -R alt:alt /app | ||
USER alt | ||
|
||
CMD ["/app/env/bin/python", "/app/start.py"] | ||
COPY requirements.* . | ||
RUN <<EOT | ||
set -ex | ||
python3 -m ensurepip | ||
pip3 install -r requirements.devel.txt | ||
rm requirements.* | ||
EOT |
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,20 +1,18 @@ | ||
version: "3.9" | ||
services: | ||
sign_file: | ||
env_file: | ||
- .env | ||
image: sign-file:latest | ||
build: | ||
dockerfile: Dockerfile | ||
context: . | ||
command: > | ||
bash -c "/app/env/bin/python /app/db_manage.py dev_init | ||
&& /app/env/bin/python /app/start.py" | ||
restart: on-failure | ||
# We could use: | ||
# env_file: | ||
# - path: "./.env" | ||
# required: false | ||
# but it doesn't work on GitHub currently | ||
# https://github.com/docker/compose/issues/11591 | ||
env_file: "./.env" | ||
command: "bash -c 'python3 db_manage.py dev_init && python3 start.py'" | ||
volumes: | ||
- "${SF_HOST_GNUPG}:/home/alt/.gnupg" | ||
- ./sign:/app/sign | ||
- ./start.py:/app/start.py | ||
- ./db_manage.py:/app/db_manage.py | ||
- "${SF_HOST_GNUPG:-./.gnupg}:/root/.gnupg" | ||
- ".:/app" | ||
ports: | ||
- "8000:8000" |
Oops, something went wrong.