forked from rbkmoney/binbase-test-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 1.59 KB
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM --platform=$BUILDPLATFORM ghcr.io/valitydev/binbase:sha-633c44f as build
USER root
RUN apt update \
&& apt install -y \
postgresql \
&& rm -rf /var/lib/apt/lists/*
COPY data /opt/binbase-test-data/data
USER postgres
RUN service postgresql start \
&& psql --command "CREATE DATABASE binbase;" \
&& psql --command "ALTER USER postgres WITH SUPERUSER PASSWORD 'postgres';" \
&& java -jar /opt/binbase/binbase.jar dev.vality.binbase.config.BatchConfig binBaseJob --logging.level.dev.vality.binbase=ERROR --logging.level.dev.vality.binbase.batch.listener.DefaultChunkListener=INFO --batch.file_path=file:/opt/binbase-test-data/data --batch.shutdown_after_execute=true --server.port=0 --batch.strict_mode=false \
&& psql --command "SELECT pg_size_pretty(pg_database_size('binbase'));" \
&& psql --command "VACUUM FULL;" \
&& psql --command "SELECT pg_size_pretty(pg_database_size('binbase'));" \
&& service postgresql stop
FROM ghcr.io/valitydev/binbase:sha-633c44f
COPY entrypoint.sh /opt/binbase-test-data/entrypoint.sh
USER root
RUN apt update \
&& apt install -y \
postgresql \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /opt/binbase-test-data/entrypoint.sh
USER postgres
COPY --chown=postgres:postgres --from=build /var/lib/postgresql/ /var/lib/postgresql/
COPY --chown=postgres:postgres --from=build /etc/postgresql/ /etc/postgresql/
WORKDIR /opt/binbase-test-data
ENTRYPOINT ["/opt/binbase-test-data/entrypoint.sh"]
CMD ["java", "-Xmx256m", "-jar","/opt/binbase/binbase.jar", "--spring.batch.job.enabled=false --batch.strict_mode=false"]
EXPOSE 8022