Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Linux scripts always need to have lf
*.sh text eol=lf
40 changes: 40 additions & 0 deletions Docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Docker files details

## Development environment

1. dev.Dockerfile

The purpose of this file is to facilitate the setup of Admin API docker image in
the development environment, allowing for local testing with latest changes.
It utilizes the assets and dlls from "Docker\Application\EdFi.Ods.AdminApi"
folder.

2. dbadmin.Dockerfile

Purpose of this file to setup the EdFi_Admin database image which includes Admin
API specific tables. It utilizes database artifacts located at
"Docker\Application\EdFi.Ods.AdminApi\Artifacts\PgSql\Structure\Admin".

> [!NOTE]
> The "EdFi.Ods.AdminApi" application folder and "Nuget.config" file will be
> copied over, either manually or through the execution of a script(`build.ps1
> -Command "CopyApplicationFilesToDockerContext"`), to the "Application" folder
> within the "Docker" directory.

## Non-development environments

1. api.Dockerfile

File for setting up Admin API docker image with assets and dlls sourced from
"EdFi.Suite3.ODS.AdminApi" nuget package(from
https://pkgs.dev.azure.com/ed-fi-alliance).

2. \Docker\Settings\DB-Admin\pgsql\Dockerfile

This file to setup the EdFi_Admin database image which includes Admin API
specific tables. The database artifacts will be downloaded from
"EdFi.Suite3.ODS.AdminApi" nuget package(from
https://pkgs.dev.azure.com/ed-fi-alliance).

For detailed instructions on setting up docker containers, please refer
[docker.md](../docs/docker.md).
14 changes: 10 additions & 4 deletions Docker/Settings/DB-Admin/pgsql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

FROM edfialliance/ods-api-db-admin:7.1
FROM edfialliance/ods-api-db-admin:7.1 as base
LABEL maintainer="Ed-Fi Alliance, LLC and Contributors <techsupport@ed-fi.org>"

ENV POSTGRES_USER=${POSTGRES_USER}
Expand All @@ -12,18 +12,24 @@ ENV POSTGRES_DB=postgres

ARG VERSION=latest

USER root
COPY run-adminapi-migrations.sh /docker-entrypoint-initdb.d/3-run-adminapi-migrations.sh
RUN apk --no-cache add dos2unix=~7.4 unzip=~6.0
USER postgres

FROM base as setup

USER root
RUN apk --no-cache add dos2unix=~7.4 unzip=~6.0 && \
wget -nv -O /tmp/EdFi_AdminApi_Scripts.zip https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_apis/packaging/feeds/EdFi/nuget/packages/EdFi.Suite3.ODS.AdminApi/versions/${VERSION}/content && \
RUN wget -nv -O /tmp/EdFi_AdminApi_Scripts.zip "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_apis/packaging/feeds/EdFi/nuget/packages/EdFi.Suite3.ODS.AdminApi/versions/${VERSION}/content" && \
unzip /tmp/EdFi_AdminApi_Scripts.zip AdminApi/Artifacts/PgSql/Structure/Admin/* -d /tmp/AdminApiScripts/ && \
cp -r /tmp/AdminApiScripts/AdminApi/Artifacts/PgSql/Structure/Admin/. /tmp/AdminApiScripts/PgSql/ && \
rm -f /tmp/EdFi_AdminApi_Scripts.zip && \
rm -r /tmp/AdminApiScripts/AdminApi && \
dos2unix /docker-entrypoint-initdb.d/3-run-adminapi-migrations.sh && \
dos2unix /tmp/AdminApiScripts/PgSql/* && \
chmod -R 777 /tmp/AdminApiScripts/PgSql
USER postgres

EXPOSE 5432
USER postgres

CMD ["docker-entrypoint.sh", "postgres"]
4 changes: 2 additions & 2 deletions Docker/Settings/ssl/generate-certificate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
set -e
set -x

openssl dhparam -out dhparam.pem 4096
openssl req -subj '//CN=localhost' -x509 -newkey rsa:4096 -nodes -keyout server.key -out server.crt -days 365 -addext "subjectAltName = DNS:nginx"
openssl dhparam -out dhparam.pem 2048
openssl req -subj '/CN=localhost' -x509 -newkey rsa:2048 -nodes -keyout server.key -out server.crt -days 365 -addext "subjectAltName = DNS:nginx"
2 changes: 1 addition & 1 deletion Docker/api.Dockerfile
Comment thread
CSR2017 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY Settings/"${DB}"/log4net.config /app/log4net.txt

RUN apk --no-cache add curl=~8 unzip=~6 dos2unix=~7 bash=~5 gettext=~0 jq=~1 icu=~72 && \
if [ "$DB" = "pgsql" ]; then apk --no-cache add postgresql13-client=~13; fi && \
wget -nv -O /app/AdminApi.zip https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_apis/packaging/feeds/EdFi/nuget/packages/EdFi.Suite3.ODS.AdminApi/versions/${VERSION}/content && \
wget -nv -O /app/AdminApi.zip "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_apis/packaging/feeds/EdFi/nuget/packages/EdFi.Suite3.ODS.AdminApi/versions/${VERSION}/content" && \
unzip /app/AdminApi.zip AdminApi/* -d /app/ && \
cp -r /app/AdminApi/. /app/ && \
rm -f /app/AdminApi.zip && \
Expand Down
10 changes: 7 additions & 3 deletions Docker/dbadmin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ ENV POSTGRES_USER=${POSTGRES_USER}
ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ENV POSTGRES_DB=postgres

USER root
COPY Settings/DB-Admin/pgsql/run-adminapi-migrations.sh /docker-entrypoint-initdb.d/3-run-adminapi-migrations.sh
COPY Application/EdFi.Ods.AdminApi/Artifacts/PgSql/Structure/Admin/ /tmp/AdminApiScripts/PgSql
COPY Settings/dev/adminapi-test-seeddata.sql /tmp/AdminApiScripts/PgSql/adminapi-test-seeddata.sql

RUN apk --no-cache add dos2unix=~7.4 unzip=~6.0
USER postgres

USER root
RUN apk --no-cache add dos2unix=~7.4 unzip=~6.0 && \
dos2unix /docker-entrypoint-initdb.d/3-run-adminapi-migrations.sh && \
RUN dos2unix /docker-entrypoint-initdb.d/3-run-adminapi-migrations.sh && \
dos2unix /tmp/AdminApiScripts/PgSql/* && \
chmod -R 777 /tmp/AdminApiScripts/PgSql/*
USER postgres

EXPOSE 5432
USER postgres

CMD ["docker-entrypoint.sh", "postgres"]
9 changes: 5 additions & 4 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ graph LR
E --> F[(EdFi_Admin)]
E --> G[(EdFi_Security)]
D --> H[(PGBouncer)]
H --> I[(EdFi_ODS{0})]
H --> I[(EdFi_ODS)]
D --> E

subgraph pb-admin
Expand Down Expand Up @@ -57,12 +57,13 @@ style I fill:#fff
directory:

```bash
cd Application/EdFi.Ods.AdminApi/Docker/ssl
cd Docker/Settings/ssl
bash ./generate-certificate.sh
```

2. Copy and customize the `.env.example` file. Importantly, be sure to change
the encryption key.
the encryption key. In a Bash prompt, generate a random key thusly: `openssl
rand -base64 32`.

```shell
cd ../../Compose/pgsql
Comment thread
CSR2017 marked this conversation as resolved.
Outdated
Expand Down Expand Up @@ -166,4 +167,4 @@ For testing pre-built binaries, use `compose-build-binaries-multi-tenant.yml`.
## Admin Api and Ed-Fi ODS / API docker containers

Please refer [DOCKER DEPLOYMENT](https://techdocs.ed-fi.org/display/EDFITOOLS/Docker+Deployment) for
installing and configuring Admin Api along with Ed-Fi ODS / API on Docker containers for testing.
installing and configuring Admin Api along with Ed-Fi ODS / API on Docker containers for testing.