-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from emadshaaban92/master
- Loading branch information
Showing
6 changed files
with
64 additions
and
46 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
### APP ######################################################################## | ||
DATABASE_URL="postgres://Dandoh:[email protected]:5432/webhaskell?sslmode=disable" | ||
JWT_SECRET="my_jwt_secret" | ||
DATABASE_URL=postgres://Dandoh:[email protected]:5432/webhaskell?sslmode=disable | ||
JWT_SECRET=my_jwt_secret | ||
|
||
### Docker ENV - PostgreSQL #################################################### | ||
POSTGRES_PASSWORD="dandoh" | ||
POSTGRES_USER="Dandoh" | ||
POSTGRES_DB="webhaskell" | ||
POSTGRES_PASSWORD=dandoh | ||
POSTGRES_USER=Dandoh | ||
POSTGRES_DB=webhaskell |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
FROM haskell:8.6.5 | ||
FROM haskell:8.8.3 | ||
|
||
### Install PostgreSQL | ||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list | ||
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | ||
RUN apt-get update | ||
RUN apt-get -y install postgresql-11 | ||
RUN apt-get install libpq-dev | ||
### Install libpq-dev for postgres haskell lib to be built & entr for detecting changes and restarting stack | ||
RUN apt-get update \ | ||
&& apt-get -y install libpq-dev entr \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG pg_password | ||
ARG pg_user | ||
ARG pg_db | ||
USER postgres | ||
RUN /etc/init.d/postgresql start && psql --command "CREATE USER $pg_user WITH SUPERUSER PASSWORD '$pg_password';" && createdb -O $pg_user $pg_db | ||
USER root | ||
WORKDIR /root/ | ||
|
||
### Install dbmate | ||
RUN curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/download/v1.7.0/dbmate-linux-amd64 | ||
RUN chmod +x /usr/local/bin/dbmate | ||
## Prebuild dependencies | ||
COPY stack.* package.yaml /root/ | ||
RUN stack build --only-dependencies | ||
|
||
WORKDIR /root/ | ||
|
||
COPY ./entrypoint.sh /opt/entrypoint.sh | ||
RUN chmod +x /opt/entrypoint.sh | ||
ENTRYPOINT ["/opt/entrypoint.sh"] | ||
|
||
COPY . /root | ||
|
||
ENTRYPOINT ["/opt/entrypoint.sh"] |
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
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
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
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