-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-api-db-provisioning
- Loading branch information
Showing
17 changed files
with
1,358 additions
and
285 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
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
declare DOCKER_USER | ||
DOCKER_UID="$(id -u)" | ||
DOCKER_GID="$(id -g)" | ||
DOCKER_USER="${DOCKER_UID}:${DOCKER_GID}" | ||
|
||
DOCKER_USER=${DOCKER_USER} \ | ||
DOCKER_UID=${DOCKER_UID} \ | ||
DOCKER_GID=${DOCKER_GID} \ | ||
docker compose run --rm opendata pipenv run data7 "$@" |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ENV_FOR_DYNACONF=development | ||
DATA7_DATABASE_URL=postgresql+asyncpg://qualicharge:pass@postgresql:5432/qualicharge-api | ||
DATA7_HOST=0.0.0.0 | ||
DATA7_PORT=8000 |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Data7 secrets. | ||
# | ||
|
||
# Will be set via environment variables | ||
|
||
# ---- DEFAULT --------------------------------- | ||
default: | ||
DATABASE_URL: "" |
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,15 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to | ||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
|
||
- Configured Data7 0.5.0 | ||
|
||
[unreleased]: https://github.com/MTES-MCT/qualicharge/ |
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,47 @@ | ||
# -- Base image -- | ||
FROM python:3.12-slim | ||
|
||
ARG DOCKER_UID 1000 | ||
ARG DOCKER_GID 1000 | ||
|
||
# Upgrade system packages to install security updates | ||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Upgrade pip to its latest release to speed up dependencies | ||
# installation | ||
RUN pip install --upgrade pip && \ | ||
pip install pipenv==2024.0.1 | ||
|
||
# Pipenv configuration | ||
ENV PIPENV_USER_UID ${DOCKER_UID} | ||
ENV PIPENV_USER_GID ${DOCKER_GID} | ||
ENV PIPENV_USER_NAME pipenv | ||
ENV PIPENV_GROUP_NAME pipenv | ||
ENV PIPENV_USER_HOME /opt/pipenv/ | ||
ENV PIPENV_CUSTOM_VENV_NAME qualicharge | ||
|
||
# Create a pipenv user and group | ||
RUN groupadd \ | ||
-g ${PIPENV_USER_GID} \ | ||
${PIPENV_GROUP_NAME} && \ | ||
useradd -rm \ | ||
-d ${PIPENV_USER_HOME} \ | ||
-s /bin/bash \ | ||
-u ${PIPENV_USER_UID} \ | ||
-g ${PIPENV_USER_GID} \ | ||
${PIPENV_USER_NAME} | ||
|
||
# /app will be our working directory | ||
RUN mkdir /app && \ | ||
chown ${PIPENV_USER_NAME}:${PIPENV_GROUP_NAME} /app | ||
|
||
# -- build (⚠️ development only) -- | ||
COPY --chown="${PIPENV_USER_NAME}:${PIPENV_GROUP_NAME}" . /app | ||
WORKDIR /app | ||
USER ${PIPENV_USER_NAME}:${PIPENV_GROUP_NAME} | ||
RUN pipenv install -de . | ||
|
||
# -- Run -- | ||
CMD pipenv run honcho start |
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,15 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
data7 = "==0.5.0" | ||
databases = {extras = ["asyncpg"], version = "==0.9.0"} | ||
|
||
[dev-packages] | ||
honcho = "==1.1.0" | ||
setuptools = "==70.1.1" | ||
|
||
[requires] | ||
python_version = "3.12" |
Oops, something went wrong.