Last active
May 7, 2019 04:54
-
-
Save hieulm/e5b554c8e4f59090c95770b173b63d87 to your computer and use it in GitHub Desktop.
comspaces deployment with docker-compose
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
version: "3" | |
networks: | |
kong-net: | |
services: | |
kong-database: | |
image: postgres:9.6 | |
environment: | |
- POSTGRES_USER=kong | |
- POSTGRES_DB=kong | |
networks: | |
- kong-net | |
ports: | |
- 5432:5432 | |
kong-migration: | |
image: kong:latest | |
command: kong migrations bootstrap | |
environment: | |
- KONG_DATABASE=postgres | |
- KONG_PG_HOST=kong-database | |
networks: | |
- kong-net | |
depends_on: | |
- kong-database | |
kong: | |
image: kong:latest | |
networks: | |
- kong-net | |
environment: | |
- KONG_DATABASE=postgres | |
- KONG_PG_HOST=kong-database | |
- KONG_ADMIN_LISTEN=0.0.0.0:8001 | |
- KONG_PROXY_ACCESS_LOG=/dev/stdout | |
- KONG_ADMIN_ACCESS_LOG=/dev/stdout | |
- KONG_PROXY_ERROR_LOG=/dev/stderr | |
- KONG_ADMIN_ERROR_LOG=/dev/stderr | |
depends_on: | |
- kong-database | |
ports: | |
- 8000:8000 | |
- 8443:8443 | |
- 8001:8001 | |
- 8444:8444 | |
konga-prepare: | |
image: pantsel/konga:latest | |
command: "-c prepare -a postgres -u postgresql://kong@kong-database:5432/konga_db" | |
networks: | |
- kong-net | |
restart: on-failure | |
depends_on: | |
- kong-database | |
konga: | |
image: pantsel/konga:latest | |
environment: | |
- DB_ADAPTER=postgres | |
- DB_HOST=kong-database | |
- DB_USER=kong | |
- DB_DATABASE=konga_db | |
- NODE_ENV=development | |
depends_on: | |
- kong-database | |
ports: | |
- 1337:1337 | |
networks: | |
- kong-net | |
restart: always |
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 node:10.15.3-alpine | |
WORKDIR /opt | |
ENV PORT=8000 | |
ENV HOST=localhost | |
ENV NODE_ENV=development | |
ENV RABBIT_URL=amqp://rabbit:rabbit@localhost/comspaces | |
ENV POSTGRES_URL=postgres://postgres:secret@localhost:5432/user-service | |
ENV MONGO_URL=mongodb://mongodb-host:27017/user-service | |
COPY package*.json /opt/ | |
RUN apk update && apk upgrade \ | |
&& apk add --no-cache git \ | |
&& apk --no-cache add --virtual builds-deps build-base python \ | |
&& npm install node-gyp node-pre-gyp \ | |
&& npm rebuild bcrypt --build-from-source | |
COPY ./ /opt | |
EXPOSE 8000 | |
CMD ["npm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment