-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f04732
commit ff1ad31
Showing
23 changed files
with
464 additions
and
186 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,14 @@ | ||
name: Opdrachten Team Dependabot | ||
|
||
on: | ||
schedule: # Run the script every day at 6am UTC | ||
- cron: "0 6 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
dependabot: | ||
name: Templates | ||
uses: amsterdam/github-workflows/.github/workflows/dependabot.yml@v1 | ||
secrets: inherit | ||
with: | ||
check_diff: 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 |
---|---|---|
@@ -1,41 +1,70 @@ | ||
FROM python:3.11-bookworm as base | ||
|
||
ENV PYTHONUNBUFFERED=1 \ | ||
PIP_NO_CACHE_DIR=off \ | ||
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt | ||
ENV TZ=Europe/Amsterdam | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV PIP_NO_CACHE_DIR=off | ||
|
||
WORKDIR /api | ||
|
||
COPY ca/* /usr/local/share/ca-certificates/extras/ | ||
|
||
RUN apt-get update \ | ||
&& apt-get dist-upgrade -y \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get install --no-install-recommends -y \ | ||
&& apt-get install -y --no-install-recommends \ | ||
nano \ | ||
openssh-server \ | ||
locales \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf/*-old \ | ||
&& pip install --upgrade pip \ | ||
&& pip install uwsgi \ | ||
&& chmod -R 644 /usr/local/share/ca-certificates/extras/ \ | ||
&& update-ca-certificates | ||
&& pip install uwsgi | ||
|
||
COPY requirements.txt /api | ||
|
||
RUN sed -i -e 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
locale-gen | ||
ENV LANG nl_NL.UTF-8 | ||
ENV LANGUAGE nl_NL:nl | ||
ENV LC_ALL nl_NL.UTF-8 | ||
|
||
COPY requirements.txt /api | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY ./scripts /api/scripts | ||
COPY ./app /api/app | ||
COPY ./uwsgi.ini /api | ||
COPY ./test.sh /api | ||
COPY .flake8 /api | ||
|
||
|
||
FROM base as tests | ||
|
||
COPY conf/test.sh /api/ | ||
COPY .flake8 /api/ | ||
|
||
RUN chmod u+x /api/test.sh | ||
|
||
CMD uwsgi --uid www-data --gid www-data --ini /api/uwsgi.ini | ||
ENTRYPOINT [ "/bin/sh", "/api/test.sh"] | ||
|
||
FROM base as publish | ||
|
||
# ssh ( see also: https://github.com/Azure-Samples/docker-django-webapp-linux ) | ||
ENV SSH_PASSWD "root:Docker!" | ||
|
||
EXPOSE 8000 | ||
ENV PORT 8000 | ||
|
||
ARG MA_OTAP_ENV | ||
ENV MA_OTAP_ENV=$MA_OTAP_ENV | ||
|
||
ARG MA_BUILD_ID | ||
ENV MA_BUILD_ID=$MA_BUILD_ID | ||
|
||
ARG MA_GIT_SHA | ||
ENV MA_GIT_SHA=$MA_GIT_SHA | ||
|
||
COPY conf/uwsgi.ini /api/ | ||
COPY conf/docker-entrypoint.sh /api/ | ||
COPY conf/sshd_config /etc/ssh/ | ||
|
||
RUN chmod u+x /api/docker-entrypoint.sh \ | ||
&& echo "$SSH_PASSWD" | chpasswd | ||
|
||
ENTRYPOINT [ "/bin/sh", "/api/docker-entrypoint.sh"] | ||
|
||
FROM publish as publish-final | ||
|
||
COPY /files /app/files |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This Makefile is based on the Makefile defined in the Python Best Practices repository: | ||
# https://git.data.amsterdam.nl/Datapunt/python-best-practices/blob/master/dependency_management/ | ||
|
||
PYTHON = python3 | ||
|
||
pip-tools: | ||
pip install pip-tools | ||
|
||
requirements: pip-tools ## Upgrade requirements (in requirements-root.txt) to latest versions and compile requirements.txt | ||
pip-compile --upgrade --output-file requirements.txt requirements-root.txt | ||
|
||
diff: | ||
@python3 ./scripts/diff.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
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
Oops, something went wrong.