Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. version: "3"
  2. services:
  3.   web:
  4.     build: .
  5.     volumes:
  6.       - ./:/usr/src/app/
  7.       - /usr/src/app/node_modules
  8.     ports:
  9.       - “3000:3000”
  10.     depends_on:
  11.       - postgres
  12.   postgres:
  13.     container_name: postgres
  14.     build:
  15.       context: .
  16.       dockerfile: pgDockerfile
  17.     environment:
  18.       POSTGRES_PASSWORD: test
  19.       POSTGRES_USER: test
  20.     ports:
  21.       - 5432:5432
  22.  
  23. FROM postgres:9.6-alpine
  24.  
  25. # copy init sql
  26. ADD 00-initial.sql /docker-entrypoint-initdb.d/
  27.  
  28. CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
  29. CREATE TABLE IF NOT EXISTS test (
  30.     id text NOT NULL,
  31.     title varchar(200) NOT NULL
  32. );
  33.  
  34. postgres | CREATE DATABASE
  35. postgres |
  36. postgres | CREATE ROLE
  37. postgres |
  38. postgres |
  39. postgres | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/00-initial-data.sql
  40. postgres | CREATE EXTENSION
  41. postgres | CREATE TABLE
  42. postgres |
  43. postgres |
  44. postgres | LOG: received fast shutdown request
  45. postgres | LOG: aborting any active transactions
  46. postgres | waiting for server to shut down....LOG: autovacuum launcher shutting down
  47. postgres | LOG: shutting down
  48. postgres | LOG: database system is shut down
  49. postgres | done
  50. postgres | server stopped
  51. postgres |
  52. postgres | PostgreSQL init process complete; ready for start up.
  53. postgres |
  54. postgres | LOG: database system was shut down at 2017-03-22 21:36:16 UTC
  55. postgres | LOG: MultiXact member wraparound protections are now enabled
  56. postgres | LOG: database system is ready to accept connections
  57. postgres | LOG: autovacuum launcher started
  58.  
  59. docker exec -it $(my postgres container id) sh
  60.  
  61. #su - postgres
  62.  
  63. #psql
  64.  
  65. # d => No relations found.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement