Guest User

Untitled

a guest
Feb 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. version: '2'
  2. services:
  3.  
  4. db:
  5. image: postgres
  6. environment:
  7. - POSTGRES_PASSWORD=wikitelegrambot
  8. command: psql -U postgres
  9. command: CREATE TABLE users(ID SERIAL PRIMARY KEY, TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP, USERNAME TEXT, CHAT_ID INT, MESSAGE TEXT, ANSWER TEXT);
  10.  
  11. bot:
  12. image: alpine
  13. volumes:
  14. - /code:/lib
  15. command: sh -c "cd lib && cd code && apk add --no-cache ca-certificates && chmod +x code && ./code"
  16.  
  17. Creating network "telegrambotgo_default" with the default driver
  18. Creating telegrambotgo_bot_1 ... done
  19. Creating telegrambotgo_db_1 ... done
  20. Attaching to telegrambotgo_bot_1, telegrambotgo_db_1
  21. bot_1 | standard_init_linux.go:195: exec user process caused "no such file or directory"
  22. db_1 | /usr/local/bin/docker-entrypoint.sh: line 145: exec: CREATE: not found
  23. telegrambotgo_bot_1 exited with code 1
  24. telegrambotgo_db_1 exited with code 127
  25.  
  26. FROM alpine
  27. COPY /code/code /
  28. RUN apk add --no-cache ca-certificates &&
  29. chmod +x code
  30. EXPOSE 80/tcp
  31. CMD [ "./code" ]
  32.  
  33. docker run --name db -e POSTGRES_PASSWORD=mypassword -d postgres
  34. docker exec -it db bash
  35. psql -U postgres
  36. CREATE TABLE users(ID SERIAL PRIMARY KEY, TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP, USERNAME TEXT, CHAT_ID INT, MESSAGE TEXT, ANSWER TEXT);
  37. docker run --name bot --link db -d myapp
  38.  
  39. host=172.17.0.2 port=5432 user=postgres password=wikitelegrambot dbname=postgres sslmode=disable
Add Comment
Please, Sign In to add comment