Skip to content

Commit

Permalink
Add docker-compose files [WiP]
Browse files Browse the repository at this point in the history
  • Loading branch information
saerdnaer committed Oct 7, 2018
1 parent 1801e7d commit e698a48
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# c3data


## setup

```
docker-compose up postgres
docker exec -i c3data_postgres_1 psql c3data < c3d-graphql/schema.sql
```

## usage

```
docker-compose up c3d-graphql
```
12 changes: 12 additions & 0 deletions c3d-graphql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:8.9.0

WORKDIR /app

ENV NODE_ENV=production
#ADD package.json yarn.lock .npmrc /app/
#RUN unset NODE_ENV; yarn install

ADD . /app/

#RUN yarn build
#CMD npx postgraphile -c postgres:///c3data -w -h 0.0.0.0 -p 5000
20 changes: 20 additions & 0 deletions c3d-web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:8.9.0

# ARGUMENT DEFINITION
ARG INSTALL_WATCHMAN=false

WORKDIR /app

# INSTALL WATCHMAN
ADD ./scripts /app/scripts/
RUN if [ "$INSTALL_WATCHMAN" = "true" ] ; then ./scripts/installWatchman.sh ; else echo "watchman installation skipped" ; fi

# INSTALL NODEJS DEPENDENCIES
ENV NODE_ENV=production
ADD package.json yarn.lock .npmrc /app/
RUN unset NODE_ENV; yarn install

ADD . /app/

RUN yarn build
CMD yarn start
Empty file added c3d-web/env.docker
Empty file.
28 changes: 28 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.4'
services:
c3d-web:
build:
context: ./c3d-web
args:
- INSTALL_WATCHMAN=true
depends_on: ['c3d-graphql']
volumes: ['./c3d-web:/app']
env_file: ./c3d-web/env.docker
ports:
- 8080:8080
links: ['c3d-graphql']
command: yarn start
c3d-graphql:
build: c3d-graphql
depends_on: ['postgres']
command: npx postgraphile -c "postgres://graphql:graphql@postgres/c3data" --watch
links: ['postgres']
ports: ['5000:5000']
postgres:
image: postgres:10.5
environment:
- POSTGRES_DB=c3data
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
volumes: ['./data/postgres:/var/lib/postgresql/data']
ports: ['5432:5432']

0 comments on commit e698a48

Please sign in to comment.