Created
May 18, 2017 14:10
-
-
Save nsisodiya/fa70793e6dcc2dff1e216611d07137ef to your computer and use it in GitHub Desktop.
docker-compose for node alpine with Yarn + postgresql db
This file contains hidden or 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
| POSTGRES_DB=xyzdb | |
| POSTGRES_USER=xyzuser | |
| POSTGRES_PASSWORD=xyzpassword |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| POSTGRES_DB=xyzdb | |
| POSTGRES_USER=xyzuser | |
| export PGPASSWORD=xyzpassword | |
| pg_dump -h localhost -U $POSTGRES_USER $POSTGRES_DB > dump.sql |
This file contains hidden or 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
| POSTGRES_DB=xyzodb | |
| POSTGRES_USER=xyzuser | |
| export PGPASSWORD=xyzpassword | |
| dropdb -U $POSTGRES_USER -e --if-exists $POSTGRES_DB | |
| createdb -U $POSTGRES_USER $POSTGRES_DB | |
| cat ./dump.sql | psql -U $POSTGRES_USER --dbname=$POSTGRES_DB |
This file contains hidden or 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
| version: '3' | |
| volumes: | |
| # We'll define a volume that will store the data from the postgres databases: | |
| postgres-data: | |
| driver: local | |
| services: | |
| billexo-graphql-server: | |
| build: . | |
| tty: true | |
| stdin_open: true | |
| links: | |
| - "billexo-db-server:billexodbserver" | |
| volumes: | |
| - ./:/billexo-graphql-server | |
| ports: | |
| - "3000:3000" | |
| billexo-db-server: | |
| image: postgres | |
| env_file: | |
| - database-variables.env | |
| volumes: | |
| - postgres-data:/var/lib/postgresql/data | |
| - ./db:/root/db | |
| ports: | |
| - "5432:5432" |
This file contains hidden or 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 node:7.10.0-alpine | |
| RUN apk add --update curl | |
| RUN apk add --update tar | |
| RUN rm -rf /var/cache/apk/* | |
| RUN curl -o- -L https://yarnpkg.com/install.sh | /bin/sh | |
| WORKDIR /billexo-graphql-server | |
| CMD ["/bin/sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment