Skip to content

Commit

Permalink
feat(docker): use shorter prefix (#88)
Browse files Browse the repository at this point in the history
* feat(docker): use shorter prefix
* chore: updated README
  • Loading branch information
serge1peshcoff authored Jun 22, 2020
1 parent cd9d9ef commit 34e17f2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
image: ubuntu-1604:201903-01
steps:
- checkout
- run: docker-compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml build --no-cache oms-discounts
- run: docker-compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml build --no-cache discounts
eslint:
machine:
image: ubuntu-1604:201903-01
Expand Down Expand Up @@ -71,10 +71,10 @@ jobs:
which node && node -v
- run: npm install
- run: npx semantic-release
- run: docker build --tag aegee/oms-discounts:$(node -p "require('./package.json').version") --tag aegee/oms-discounts:latest -f ./docker/oms-discounts/Dockerfile .
- run: docker build --tag aegee/discounts:$(node -p "require('./package.json').version") --tag aegee/discounts:latest -f ./docker/discounts/Dockerfile .
- run: docker login --username $DOCKER_LOGIN --password $DOCKER_PASSWORD
- run: docker push aegee/oms-discounts:$(node -p "require('./package.json').version")
- run: docker push aegee/oms-discounts:latest
- run: docker push aegee/discounts:$(node -p "require('./package.json').version")
- run: docker push aegee/discounts:latest
- slack/status:
success_message: The Docker image for \`$CIRCLE_PROJECT_REPONAME\` with tags \`$(node -p "require('./package.json').version")\` and \`latest\` has been pushed to Dockerhub.
failure_message: The Docker image for \`$CIRCLE_PROJECT_REPONAME\` build and push has failed.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# OMS Discounts module
[![Build Status](https://travis-ci.org/AEGEE/oms-discounts.svg)](https://travis-ci.org/AEGEE/oms-discounts)
![Codecov branch for master](https://img.shields.io/codecov/c/github/AEGEE/oms-discounts.svg)
# Discounts module
![CircleCI](https://img.shields.io/circleci/build/github/AEGEE/discounts)
![Codecov branch for master](https://img.shields.io/codecov/c/github/AEGEE/discounts.svg)


## General

The discounts module of OMS is responsible for distributing discount codes (Flixbus, N26 etc.);
The discounts module of MyAEGEE is responsible for distributing discount codes (Flixbus, N26 etc.);

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
default: {
port: 8084,
postgres: {
host: process.env.DB_HOST || 'postgres-oms-discounts',
host: process.env.DB_HOST || 'postgres-discounts',
port: parseInt(process.env.DB_PORT, 10) || 5432,
username: process.env.USERNAME || 'postgres',
password: process.env.PG_PASSWORD || 'postgres',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN mkdir -p /usr/app/src \
&& mkdir -p /usr/app/media \
&& mkdir -p /usr/app/scripts

COPY ./docker/oms-discounts/bootstrap.sh /usr/app/scripts/bootstrap.sh
COPY ./docker/discounts/bootstrap.sh /usr/app/scripts/bootstrap.sh
COPY ./ /usr/app/src

RUN chown -R node:node /usr/app
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: "3.4"

services:
oms-discounts:
discounts:
build:
context: ./${PATH_OMS_DISCOUNTS}/..
dockerfile: ./docker/oms-discounts/Dockerfile
image: aegee/oms-discounts:dev
context: ./${PATH_DISCOUNTS}/..
dockerfile: ./docker/discounts/Dockerfile
image: aegee/discounts:dev
volumes:
- ./${PATH_OMS_DISCOUNTS}/../config:/usr/app/src/config
- ./${PATH_OMS_DISCOUNTS}/../lib:/usr/app/src/lib
- ./${PATH_OMS_DISCOUNTS}/../migrations:/usr/app/src/migrations
- ./${PATH_OMS_DISCOUNTS}/../models:/usr/app/src/models
- ./${PATH_OMS_DISCOUNTS}/../cli.js:/usr/app/src/cli.js
command: "sh -c '/usr/app/scripts/bootstrap.sh && npm run nodemon-start'"
- ./${PATH_DISCOUNTS}/../config:/usr/app/src/config
- ./${PATH_DISCOUNTS}/../lib:/usr/app/src/lib
- ./${PATH_DISCOUNTS}/../migrations:/usr/app/src/migrations
- ./${PATH_DISCOUNTS}/../models:/usr/app/src/models
- ./${PATH_DISCOUNTS}/../cli.js:/usr/app/src/cli.js
command: "sh -c '/usr/app/scripts/bootstrap.sh && npm run nodemon-start | bunyan'"
24 changes: 13 additions & 11 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
version: "3.4"
### OMS DISCOUNTS #######################################
services:
postgres-oms-discounts:
postgres-discounts:
image: postgres:10
volumes:
- postgres-oms-discounts:/var/lib/postgresql/data
- postgres-discounts:/var/lib/postgresql/data
expose:
- "5432"
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "${PW_POSTGRES}"

oms-discounts:
image: aegee/oms-discounts:latest
discounts:
image: aegee/discounts:latest
volumes:
- oms-discounts-media:/usr/app/media
- discounts-media:/usr/app/media
- shared:/usr/app/shared:ro
depends_on:
- postgres-oms-discounts
- postgres-discounts
expose:
- "8084"
environment:
Expand All @@ -34,16 +34,18 @@ services:
# cpu_count: 1
# mem_limit: 900m
labels:
- "traefik.backend=oms-discounts"
- "traefik.backend=discounts"
- "traefik.port=8084"
- "traefik.frontend.rule=PathPrefix:/services/oms-discounts/api;PathPrefixStrip:/services/oms-discounts/api"
- "traefik.frontend.priority=110"
- "traefik.old.frontend.rule=PathPrefixStrip:/services/oms-discounts/api;"
- "traefik.new.frontend.rule=PathPrefixStrip:/api/discounts;"
- "traefik.old.frontend.priority=110"
- "traefik.new.frontend.priority=110"
- "traefik.enable=true"

volumes:
postgres-oms-discounts:
postgres-discounts:
driver: local
oms-discounts-media:
discounts-media:
driver: local
shared:
driver: local
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "oms-discounts",
"name": "discounts",
"version": "1.0.2",
"description": "Discounts module for OMS, for populating codes and for distributing them to AEGEE members.",
"description": "Discounts module for MyAEGEE, for populating codes and for distributing them to AEGEE members.",
"main": "lib/run.js",
"scripts": {
"start": "nodemon -e 'js,json' lib/run.js",
Expand All @@ -17,9 +17,9 @@
"author": "Sergey Peshkov <github.com/serge1peshcoff>",
"license": "ISC",
"bugs": {
"url": "https://github.com/AEGEE/oms-discounts/issues"
"url": "https://github.com/AEGEE/discounts/issues"
},
"homepage": "https://github.com/AEGEE/oms-discounts",
"homepage": "https://github.com/AEGEE/discounts",
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
Expand Down

0 comments on commit 34e17f2

Please sign in to comment.