forked from transcom/mymove
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.migrations_local
40 lines (27 loc) · 1.02 KB
/
Dockerfile.migrations_local
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
###########
# BUILDER #
###########
FROM milmove/circleci-docker:milmove-app-59d1b5d814b190c7c5a8c460ca97ed193d518350 as builder
ENV CIRCLECI=true
COPY --chown=circleci:circleci . /home/circleci/project
WORKDIR /home/circleci/project
RUN make clean
RUN make bin/rds-ca-2019-root.pem
RUN make server_generate
RUN rm -f bin/milmove && make bin/milmove
#########
# FINAL #
#########
FROM alpine:3.18.0
# hadolint ignore=DL3017
RUN apk upgrade --no-cache busybox
COPY --from=builder --chown=root:root /home/circleci/project/bin/rds-ca-2019-root.pem /bin/rds-ca-2019-root.pem
COPY --from=builder --chown=root:root /home/circleci/project/bin/milmove /bin/milmove
COPY migrations/app/schema /migrate/schema
COPY migrations/app/migrations_manifest.txt /migrate/migrations_manifest.txt
# Install tools needed in container
# hadolint ignore=DL3018
RUN apk update && apk add ca-certificates --no-cache
WORKDIR /
USER nobody
ENTRYPOINT ["/bin/milmove", "migrate", "-p", "file:///migrate/migrations", "-m", "/migrate/migrations_manifest.txt"]