Skip to content
Permalink
Browse files

Configure Dockerfile and docker-compose

  • Loading branch information...
blyszcz committed Aug 22, 2018
1 parent 66ffc90 commit 0f77d294f4319fa45cd19a9c00b5af49e9b2c20d
Showing with 47 additions and 2 deletions.
  1. +17 −0 .dockerignore
  2. +26 −0 Dockerfile
  3. +3 −2 package.json
  4. +1 −0 src/services/producer/index.ts
@@ -0,0 +1,17 @@
.bitbucket-pipelines.yml
.env
.env.dist
.git
.gitignore
.prettierrc
node_modules
data.json
docker-compose.yml
docker-compose.yml.dist
Dockerfile
README.md
src
translations
tsconfig.json
tsconfig.test.json
tslint.json
@@ -0,0 +1,26 @@
FROM node:10

WORKDIR /app

COPY package.json .

# Add credentials on build
ARG SSH_PRIVATE_KEY
ARG SSH_PUBLIC_KEY
RUN mkdir /root/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && \
echo "${SSH_PUBLIC_KEY}" > /root/.ssh/id_rsa.pub && \
chmod 600 /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa.pub

# Make sure your domain is accepted
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts

RUN npm i --production

COPY . /app

EXPOSE 3000

CMD npm run start
@@ -13,8 +13,9 @@
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"lint-fix": "tslint -c tslint.json 'src/**/*.ts' --fix",
"nsp": "nsp check",
"start-producer": "TS_NODE_FILES=true pm2 --name translations-producer start src/services/producer/index.ts",
"start-api": "TS_NODE_FILES=true pm2 start --name translations-api src/services/api/index.ts"
"start": "npm run start-producer & npm run start-api",
"start-producer": "node build/services/producer/index.js",
"start-api": "node build/services/api/index.js"
},
"bin": {
"babelsheet": "./build/services/cli/index.js"
@@ -57,6 +57,7 @@ async function main() {

const everyFiveMinutes = '*/5 * * * *';

main();
schedule.scheduleJob(everyFiveMinutes, () => {
main();
});

0 comments on commit 0f77d29

Please sign in to comment.
You can’t perform that action at this time.