Created
January 15, 2020 00:15
-
-
Save miguelmota/856e17e5d5dced113feb5bab4a7000b8 to your computer and use it in GitHub Desktop.
Dockerfile ruby standalone_migrations postgresql example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.6.5-alpine3.10 | |
# Install dependencies | |
RUN apk update && apk add build-base bash postgresql-dev zlib-dev | |
# Install gems | |
RUN gem install rake dotenv pg standalone_migrations | |
# Set postgres environment variables | |
ENV POSTGRES_HOST=127.0.0.1 | |
ENV POSTGRES_PORT=54320 | |
ENV POSTGRES_USER=docker | |
ENV POSTGRES_PASS=docker | |
ENV POSTGRES_DBNAME=docker | |
# Copy local repo into docker | |
COPY migration/ /migration | |
# Set working directory to be migration directory | |
WORKDIR /migration | |
# Set the default command to run when starting the container | |
CMD ["rake", "db:migrate"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment