Skip to content

Commit e49fe39

Browse files
kedlasMilan Felix Šulc
authored andcommitted
Added Dockerfile with czech unaccent rules based on postgres:10
1 parent a4d7881 commit e49fe39

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM postgres:10
2+
3+
RUN localedef -i cs_CZ -c -f UTF-8 -A /usr/share/locale/locale.alias cs_CZ.UTF-8
4+
ENV LANG cs_CZ.utf8
5+
6+
COPY ./czech_unaccent.tar.gz /root
7+
RUN cd /root && tar xvzf czech_unaccent.tar.gz && \
8+
cp fulltext_dicts/* $(find / -iname "tsearch_data") && \
9+
rm -rf fulltext_dicts czech.tar.gz
10+
11+
COPY ./init-scripts/* /docker-entrypoint-initdb.d/

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Postgres
2+
3+
Postgres with configured unaccent for Czech language
4+
5+
-----
6+
7+
[![Docker Stars](https://img.shields.io/docker/stars/dockette/postgres.svg?style=flat)](https://hub.docker.com/r/dockette/postgres/)
8+
[![Docker Pulls](https://img.shields.io/docker/pulls/dockette/postgres.svg?style=flat)](https://hub.docker.com/r/dockette/postgres/)
9+
10+
## Discussion / Help
11+
12+
[![Join the chat](https://img.shields.io/gitter/room/dockette/dockette.svg?style=flat-square)](https://gitter.im/dockette/dockette?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
13+
14+
## Usage
15+
16+
```sh
17+
docker build -t dockette-postgres .
18+
19+
docker run --rm -it -p 5432:5432 --name dockette-postgres dockette-postgres
20+
21+
```
22+
23+
## Credits
24+
25+
Thanks Ondrej Musil for: https://github.com/freaz/docker-postgres-czech-unaccent
26+
27+
## Tip
28+
29+
Without any docker volumes configured Postgres data will be lost after container stops.

czech_unaccent.tar.gz

919 KB
Binary file not shown.

init-scripts/init-czech-dict.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TEXT SEARCH DICTIONARY cspell
2+
(template=ispell, dictfile = czech_unaccent, afffile=czech_unaccent, stopwords=czech_unaccent);
3+
CREATE TEXT SEARCH CONFIGURATION cs (copy=english);
4+
ALTER TEXT SEARCH CONFIGURATION cs
5+
ALTER MAPPING FOR word, asciiword WITH cspell, simple;
6+
CREATE EXTENSION unaccent;

0 commit comments

Comments
 (0)