Skip to content
Snippets Groups Projects
Commit 9ce2162d authored by Matheus Horstmann's avatar Matheus Horstmann :horse:
Browse files

Issue #3: Add dockerfile

parent dcf96ff8
No related branches found
No related tags found
1 merge request!3Resolve "Criar docker especializado para o banco de dados"
Pipeline #20670 passed
*.bak
docker-compose.yml
.env
FROM debian:stretch
LABEL maintainer="horstmannmat <mch15@inf.ufpr.br>"
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
# Install dependencies:
# - build-essential: To ensure certain gems can be compiled
# - nodejs: Compile assets
# - libpq-dev: Communicate with postgres through the postgres gem
# - wget curl and gnupg is used to get newest postgres client
# - software-properties-common to use the command lsb_release
#- Get newest postgres client
RUN apt-get -y -qqq update && apt-get -qqq install -y apt-utils libpq-dev wget gnupg software-properties-common curl build-essential --fix-missing --no-install-recommends && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get -y update -qq && apt-get install -y -qq postgresql-client-10 git vim
# Set an environment variable to store where the app is installed to inside of the Docker image.
RUN useradd -ms /bin/bash agent
USER agent
ENV WORKSPACE /home/agent/agent-colector-database
RUN mkdir -p $WORKSPACE
WORKDIR $WORKSPACE
COPY --chown=agent:agent . .
ENTRYPOINT ["/home/agent/agent-colector-database/docker-entrypoint.sh"]
CMD ["/bin/bash"]
#!/bin/bash
sleep 15
export PGPASSWORD=${POSTGRES_PASSWORD}
connectcommand() {
PGPASSWORD=${POSTGRES_PASSWORD} psql -h ${POSTGRES_HOST}\
-U ${POSTGRES_USER} -c "\d"
}
connectcommand
while [ $? -ne 0 ]
do
echo "Waiting postgres start"
sleep 2
connectcommand
done
# /home/formdatabase/form-creator-database/psql-manager/manager.sh drop
/home/formdatabase/form-creator-database/psql-manager/manager.sh create /home/formdatabase/form-creator-database/workspace
/home/formdatabase/form-creator-database/psql-manager/manager.sh fixture /home/formdatabase/form-creator-database/workspace
while true
do
sleep 2
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment