Skip to content

Commit

Permalink
Change Docker config
Browse files Browse the repository at this point in the history
 - Rename explorer01 container to explorer-api01
 - Remove 'forever' dependency
 - Change supervisord config to setup db before start the API
  • Loading branch information
emiliorizzo committed Mar 5, 2020
1 parent a773095 commit 437ed1f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 31 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8
FROM node:10
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y build-essential apt-utils git curl supervisor systemd software-properties-common && \
Expand All @@ -9,12 +9,10 @@ RUN apt-get update -y && \
ADD . /rsk-explorer-api
WORKDIR /rsk-explorer-api
RUN git checkout -B docker-branch origin/master
RUN /usr/local/bin/npm install forever -g &&\
mkdir /var/log/rsk-explorer/ &&\
RUN mkdir /var/log/rsk-explorer/ &&\
touch /var/log/rsk-explorer/blocks.json &&\
touch /var/log/rsk-explorer/api.json
RUN /usr/local/bin/npm install
COPY dockerized/explorer/supervisord-api.conf /etc/supervisor/conf.d/supervisord-api.conf
COPY dockerized/explorer/config.json /rsk-explorer-api/config.json
COPY dockerized/explorer/supervisord-blocks.conf /etc/supervisor/conf.d/supervisord-blocks.conf
ENTRYPOINT ["/usr/bin/supervisord"]
RUN npm install
COPY dockerized/explorer-api/config.json /rsk-explorer-api/config.json
COPY dockerized/explorer-api/supervisord.conf /etc/supervisor/conf.d/explorer.conf
CMD ["/usr/bin/supervisord"]
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: "3"
services:
explorer01:
explorer-api:
build: .
image: explorer01:latest
image: explorer-api01:latest
depends_on:
- rsk-node
- mongod
container_name: explorer01
container_name: explorer-api01
ports:
- "3003:3003"
networks:
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions dockerized/explorer-api/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[supervisord]
nodaemon=true

[program:init]
command=/bin/bash -c "supervisorctl start setup && supervisorctl start blocks && supervisorctl start api"
autostart=true

[program:setup]
command=node /rsk-explorer-api/dist/services/blocks/setup.js
autostart=false
autorestart=false

[program:blocks]
command=node /rsk-explorer-api/dist/services/blocks
autostart=false
autorestart=true

[program:api]
command=node /rsk-explorer-api/dist/api
autostart=false
autorestart=true
10 changes: 0 additions & 10 deletions dockerized/explorer/supervisord-api.conf

This file was deleted.

10 changes: 0 additions & 10 deletions dockerized/explorer/supervisord-blocks.conf

This file was deleted.

0 comments on commit 437ed1f

Please sign in to comment.