clean up and add migrate container
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b938492ed3
commit
9bcae836f2
4 changed files with 42 additions and 91 deletions
17
.drone.yml
17
.drone.yml
|
@ -15,21 +15,6 @@ kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
name: build
|
name: build
|
||||||
steps:
|
steps:
|
||||||
# - name: publish
|
|
||||||
# image: plugins/kaniko
|
|
||||||
# pull: always
|
|
||||||
# settings:
|
|
||||||
# build_args:
|
|
||||||
# - VERSION=2.8.1
|
|
||||||
# repo: r.ocj.io/network/healthchecks
|
|
||||||
# registry: r.ocj.io
|
|
||||||
# username:
|
|
||||||
# from_secret: local_username
|
|
||||||
# password:
|
|
||||||
# from_secret: local_password
|
|
||||||
# tags:
|
|
||||||
# - "latest"
|
|
||||||
# - "${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:8}"
|
|
||||||
- name: nixos
|
- name: nixos
|
||||||
image: docker.io/jcollie/nixos-runner:latest
|
image: docker.io/jcollie/nixos-runner:latest
|
||||||
pull: always
|
pull: always
|
||||||
|
@ -42,6 +27,8 @@ steps:
|
||||||
- push-container result --repository network/healthchecks-sendalerts
|
- push-container result --repository network/healthchecks-sendalerts
|
||||||
- nix build -L .#maintenance
|
- nix build -L .#maintenance
|
||||||
- push-container result --repository network/healthchecks-maintenance
|
- push-container result --repository network/healthchecks-maintenance
|
||||||
|
- nix build -L .#migrate
|
||||||
|
- push-container result --repository network/healthchecks-migrate
|
||||||
settings:
|
settings:
|
||||||
registry: r.ocj.io
|
registry: r.ocj.io
|
||||||
username:
|
username:
|
||||||
|
|
24
Dockerfile
24
Dockerfile
|
@ -1,24 +0,0 @@
|
||||||
FROM python:3.11
|
|
||||||
|
|
||||||
ARG VERSION
|
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
|
||||||
|
|
||||||
WORKDIR /opt/healthchecks
|
|
||||||
|
|
||||||
RUN useradd --system hc && \
|
|
||||||
git clone --depth 1 --branch v${VERSION} https://github.com/healthchecks/healthchecks.git /opt/healthchecks && \
|
|
||||||
pip install --no-cache-dir --upgrade pip && \
|
|
||||||
pip install --no-cache-dir -r /opt/healthchecks/requirements.txt && \
|
|
||||||
pip install --no-cache-dir uwsgi && \
|
|
||||||
rm -f /opt/healthchecks/hc/local_settings.py && \
|
|
||||||
DEBUG=False SECRET_KEY=build-key ./manage.py collectstatic --noinput && \
|
|
||||||
DEBUG=False SECRET_KEY=build-key ./manage.py compress
|
|
||||||
|
|
||||||
COPY uwsgi.ini /opt/healthchecks/docker/uwsgi.ini
|
|
||||||
|
|
||||||
USER hc
|
|
||||||
|
|
||||||
VOLUME "/data"
|
|
||||||
EXPOSE 2525
|
|
||||||
EXPOSE 8000
|
|
27
flake.nix
27
flake.nix
|
@ -108,8 +108,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
smtpd = pkgs.dockerTools.buildLayeredImage
|
smtpd = pkgs.dockerTools.buildLayeredImage (
|
||||||
(
|
|
||||||
pkgs.lib.attrsets.recursiveUpdate baseImage {
|
pkgs.lib.attrsets.recursiveUpdate baseImage {
|
||||||
name = "healthchecks-smtpd";
|
name = "healthchecks-smtpd";
|
||||||
config = {
|
config = {
|
||||||
|
@ -126,8 +125,7 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
sendalerts = pkgs.dockerTools.buildLayeredImage
|
sendalerts = pkgs.dockerTools.buildLayeredImage (
|
||||||
(
|
|
||||||
pkgs.lib.attrsets.recursiveUpdate baseImage {
|
pkgs.lib.attrsets.recursiveUpdate baseImage {
|
||||||
name = "healthchecks-sendalerts";
|
name = "healthchecks-sendalerts";
|
||||||
config = {
|
config = {
|
||||||
|
@ -165,6 +163,19 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
migrate = pkgs.dockerTools.buildLayeredImage (
|
||||||
|
pkgs.lib.attrsets.recursiveUpdate baseImage {
|
||||||
|
name = "healthchecks-migrate";
|
||||||
|
config = {
|
||||||
|
Cmd = [
|
||||||
|
"${self.packages.${system}.healthchecks}/app/manage.py"
|
||||||
|
"migrate"
|
||||||
|
];
|
||||||
|
ExposedPorts = { };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
webserver =
|
webserver =
|
||||||
let
|
let
|
||||||
uwsgi = pkgs.uwsgi.override {
|
uwsgi = pkgs.uwsgi.override {
|
||||||
|
@ -205,14 +216,6 @@
|
||||||
"${uwsgi}/bin/uwsgi"
|
"${uwsgi}/bin/uwsgi"
|
||||||
"${uwsgi-ini}"
|
"${uwsgi-ini}"
|
||||||
];
|
];
|
||||||
# Cmd = [
|
|
||||||
# "${pkgs.python3Packages.gunicorn}/bin/gunicorn"
|
|
||||||
# "hc.wsgi"
|
|
||||||
# "--bind"
|
|
||||||
# ":8000"
|
|
||||||
# "--pythonpath"
|
|
||||||
# self.packages.${system}.healthchecks.pythonPath
|
|
||||||
# ];
|
|
||||||
ExposedPorts = {
|
ExposedPorts = {
|
||||||
"8000/tcp" = { };
|
"8000/tcp" = { };
|
||||||
};
|
};
|
||||||
|
|
15
uwsgi.ini
15
uwsgi.ini
|
@ -1,15 +0,0 @@
|
||||||
[uwsgi]
|
|
||||||
master
|
|
||||||
die-on-term
|
|
||||||
http-socket = :8000
|
|
||||||
harakiri = 10
|
|
||||||
post-buffering = 4096
|
|
||||||
processes = 4
|
|
||||||
enable-threads
|
|
||||||
threads = 1
|
|
||||||
chdir = /opt/healthchecks
|
|
||||||
module = hc.wsgi:application
|
|
||||||
thunder-lock
|
|
||||||
disable-write-exception
|
|
||||||
static-map = /static=/opt/healthchecks/static-collected
|
|
||||||
buffer-size = 32768
|
|
Loading…
Reference in a new issue