-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.migrations
More file actions
29 lines (21 loc) · 848 Bytes
/
Dockerfile.migrations
File metadata and controls
29 lines (21 loc) · 848 Bytes
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
# Dockerfile.migrations
# Imagem específica para executar migrations do jussub via ArgoCD PreSync Hook
FROM flyway/flyway:11-alpine
USER root
# Instalar postgresql-client para pg_isready e bash
RUN apk add --no-cache postgresql-client bash && \
rm -rf /var/cache/apk/*
WORKDIR /flyway
# Copiar migrations SQL
COPY src/main/resources/db/migrations/ /flyway/sql/
# Copiar script de entrypoint
COPY scripts/migration-entrypoint.sh /flyway/scripts/migration-entrypoint.sh
RUN chmod +x /flyway/scripts/migration-entrypoint.sh
# Criar usuário não-root para segurança
RUN addgroup -g 1001 -S appgroup && \
adduser -u 1001 -S appuser -G appgroup && \
chown -R appuser:appgroup /flyway
USER appuser
# Sobrescrever ENTRYPOINT da imagem base e usar nosso script
ENTRYPOINT ["/bin/bash"]
CMD ["/flyway/scripts/migration-entrypoint.sh"]