-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds a Dockerfile for pyCA and introduces some docker-compose examples with different databases. Co-authored-by: Lars Kiesow <[email protected]>
- Loading branch information
Showing
7 changed files
with
224 additions
and
1 deletion.
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,16 @@ | ||
.git | ||
Dockerfile | ||
venv | ||
*.pyc | ||
*.pyo | ||
*.swp | ||
build/ | ||
*.egg-info/ | ||
node_modules/ | ||
/pyca/ui/static/ | ||
.cache/ | ||
dist/ | ||
/recordings/* | ||
.coverage | ||
pyca.db | ||
.vscode/ |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ node_modules/ | |
dist/ | ||
|
||
/recordings/* | ||
/init/container/pyca.conf | ||
|
||
.coverage | ||
pyca.db | ||
|
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,73 @@ | ||
FROM alpine:3.13 AS build | ||
|
||
RUN apk --no-cache add \ | ||
curl-dev \ | ||
gcc \ | ||
linux-headers \ | ||
make \ | ||
musl-dev \ | ||
nodejs \ | ||
npm \ | ||
py3-pip \ | ||
python3 \ | ||
python3-dev \ | ||
util-linux \ | ||
&& ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
WORKDIR /usr/local/src | ||
|
||
COPY requirements.txt package.json package-lock.json ./ | ||
RUN pip install -r requirements.txt \ | ||
&& npm i | ||
|
||
COPY . . | ||
RUN make pypi | ||
|
||
FROM alpine:3.13 | ||
LABEL maintainer="pyCA team" | ||
|
||
ENV FFMPEG_VERSION="20200918044515-N-99257-g01506c290a" | ||
|
||
COPY --from=build /usr/local/src/dist/pyca-*.tar.gz /tmp/pyca.tar.gz | ||
|
||
RUN apk --no-cache --virtual .run-deps add \ | ||
libcurl \ | ||
postgresql-libs \ | ||
py3-pip \ | ||
python3 \ | ||
&& apk --no-cache --virtual .build-deps add \ | ||
curl \ | ||
curl-dev \ | ||
gcc \ | ||
linux-headers \ | ||
make \ | ||
musl-dev \ | ||
postgresql-dev \ | ||
python3-dev \ | ||
tar \ | ||
xz \ | ||
&& ln -s /usr/bin/python3 /usr/bin/python \ | ||
&& pip install \ | ||
/tmp/pyca.tar.gz \ | ||
gunicorn \ | ||
psycopg2 \ | ||
&& cd /usr/local/bin \ | ||
&& curl -sSL "https://pkg.opencast.org/bin/ffmpeg/ffmpeg-${FFMPEG_VERSION}.tar.xz" \ | ||
| tar xJf - --strip-components 1 --wildcards '*/ffmpeg' '*/ffprobe' \ | ||
&& apk del .build-deps \ | ||
&& rm -rf /tmp/pyca.tar.gz | ||
|
||
RUN addgroup -S -g 800 pyca \ | ||
&& adduser -S -D -h /var/lib/pyca -G pyca -u 800 pyca \ | ||
&& addgroup pyca audio \ | ||
&& addgroup pyca video | ||
|
||
COPY etc/pyca.conf etc/gunicorn.conf.py /etc/pyca/ | ||
RUN echo 'bind = "0.0.0.0:8000"' >> /etc/pyca/gunicorn.conf.py | ||
|
||
WORKDIR /var/lib/pyca | ||
USER pyca | ||
VOLUME [ "/var/lib/pyca" ] | ||
EXPOSE 8000 | ||
|
||
ENTRYPOINT [ "pyca" ] |
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,23 @@ | ||
PyCA Container Images | ||
===================== | ||
|
||
This directory contains example docker-compose files for various scenarios. | ||
|
||
PyCA + SQLite | ||
------------- | ||
|
||
.. code-block:: bash | ||
cp etc/pyca.conf init/container/pyca.conf | ||
sed -i "s|#name .*|name = pyca-container|g" init/container/pyca.conf | ||
docker-compose -f init/container/docker-compose.sqlite.yml up | ||
PyCA + PostgreSQL | ||
------------- | ||
|
||
.. code-block:: bash | ||
cp etc/pyca.conf init/container/pyca.conf | ||
sed -i "s|#name .*|name = pyca-container|g" init/container/pyca.conf | ||
sed -i "s|#database .*|database = postgresql://pyca:pyca@database/pyca|g" init/container/pyca.conf | ||
docker-compose -f init/container/docker-compose.postgres.yml up |
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,58 @@ | ||
version: '3' | ||
|
||
volumes: | ||
pyca: {} | ||
database: {} | ||
|
||
services: | ||
pyca-schedule: | ||
command: schedule | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-ingest: | ||
command: ingest | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-capture: | ||
command: capture | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-agentstate: | ||
command: agentstate | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-ui: | ||
entrypoint: ["gunicorn", "--config=/etc/pyca/gunicorn.conf.py", "pyca.ui:app"] | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
ports: | ||
- "8000:8000" | ||
|
||
database: | ||
image: postgres:12.3 | ||
restart: always | ||
environment: | ||
- POSTGRES_PASSWORD=pyca | ||
- POSTGRES_USER=pyca | ||
- POSTGRES_DB=pyca | ||
volumes: | ||
- database:/var/lib/postgresql/data |
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 @@ | ||
version: '3' | ||
|
||
volumes: | ||
pyca: {} | ||
|
||
services: | ||
pyca-schedule: | ||
command: schedule | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-ingest: | ||
command: ingest | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-capture: | ||
command: capture | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-agentstate: | ||
command: agentstate | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
|
||
pyca-ui: | ||
entrypoint: ["gunicorn", "--config=/etc/pyca/gunicorn.conf.py", "pyca.ui:app"] | ||
image: quay.io/opencast/pyca | ||
restart: always | ||
volumes: | ||
- ./pyca.conf:/etc/pyca/pyca.conf:ro | ||
- pyca:/var/lib/pyca | ||
ports: | ||
- "8000:8000" |