-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch.Dockerfile
More file actions
40 lines (32 loc) · 1 KB
/
batch.Dockerfile
File metadata and controls
40 lines (32 loc) · 1 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
FROM postgres:15
# Install necessary packages
RUN apt-get update && apt-get install -y \
awscli \
postgresql-client \
postgresql-15-postgis-3 \
postgresql-contrib \
openssh-client \
curl \
tar \
gzip \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories
RUN mkdir -p /home/app /home/archives /home/assets /var/log \
&& chown -R postgres:postgres /home/app /home/archives /home/assets /var/log
# Copy your scripts
COPY ./app/scrubbed_database.sh /home/app/
COPY ./app/connect_database.sh /home/app/
RUN chmod +x /home/app/*.sh
COPY ./archives/* /home/archives
# Create a startup script that handles both PostgreSQL and your job
COPY ./batch_entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/batch_entrypoint.sh
# Set environment variables
ENV POSTGRES_USER=postgres
ENV POSTGRES_PASSWORD=postgres
ENV POSTGRES_DB=postgres
ENV PGUSER=postgres
ENV PGDATA=/var/lib/postgresql/data
USER postgres
ENTRYPOINT ["/usr/local/bin/batch_entrypoint.sh"]