mirror of
https://github.com/djrobstep/migra.git
synced 2024-09-11 05:45:51 +03:00
Improved Docker container.
This commit is contained in:
parent
205bb3bced
commit
5860120233
12
Dockerfile
12
Dockerfile
@ -1,13 +1,15 @@
|
|||||||
FROM alpine:3.7
|
FROM alpine:3.8
|
||||||
|
|
||||||
RUN apk add --no-cache python3 ca-certificates postgresql-dev && \
|
RUN set -x && \
|
||||||
|
apk add --no-cache bash python3 ca-certificates postgresql-libs postgresql-dev && \
|
||||||
apk add --no-cache --virtual=build-dependencies build-base python3-dev && \
|
apk add --no-cache --virtual=build-dependencies build-base python3-dev && \
|
||||||
pip3 install --upgrade --no-cache-dir pip && \
|
pip3 install --upgrade --no-cache-dir pip && \
|
||||||
pip3 install --no-cache-dir psycopg2-binary migra && \
|
pip3 install --no-cache-dir psycopg2-binary migra && \
|
||||||
apk del build-dependencies && \
|
apk del build-dependencies postgresql-dev python3-dev && \
|
||||||
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
|
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/bin/migra" ]
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
|
||||||
CMD ["--help"]
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
|
||||||
|
CMD ["migra", "--help"]
|
||||||
|
14
build-docker.sh
Executable file
14
build-docker.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
printf "\n> \e[93m\033[1mBuilding Docker image\e[0m\n\n"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
ABSOLUTE_PATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
|
||||||
|
cd ${ABSOLUTE_PATH}
|
||||||
|
|
||||||
|
DOCKER_IMAGE="djrobstep/migra:latest"
|
||||||
|
|
||||||
|
printf "# Image: \e[1;37m${DOCKER_IMAGE}\e[0m\n\n"
|
||||||
|
|
||||||
|
docker build -t djrobstep/migra:latest .
|
10
docker-entrypoint.sh
Executable file
10
docker-entrypoint.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" = 'migra' ]; then
|
||||||
|
migra_command="$@"
|
||||||
|
echo "${migra_command}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
Loading…
Reference in New Issue
Block a user