Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
VP-12 docker compose files for production
Browse files Browse the repository at this point in the history
various docker compose files for different environments - ECS version uses mongo in the cloud - not creds are in clear and need fixing
  • Loading branch information
avowkind committed Mar 21, 2019
1 parent 65a62a0 commit 885a4e8
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ dist
coverage/
.nyc_output/
yarn.lock
.ssh
*.pem
5 changes: 5 additions & 0 deletions buildimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$(aws ecr get-login --no-include-email --region ap-southeast-1)
docker build -t vly1-main-repo .
docker tag vly1-main-repo:latest 585172581592.dkr.ecr.ap-southeast-1.amazonaws.com/vly1-main-repo:latest
docker push 585172581592.dkr.ecr.ap-southeast-1.amazonaws.com/vly1-main-repo:latest

2 changes: 1 addition & 1 deletion client/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:root {
--fore-color: #111;
--secondary-fore-color: #444;
--back-color: #f8f8f8;
--back-color: #fcfcfc;
--secondary-back-color: #f0f0f0;
--blockquote-color: #f57c00;
--pre-color: #1565c0;
Expand Down
1 change: 1 addition & 0 deletions client/modules/App/components/Header/Vlogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React from 'react';
export function Vlogo() {
return (
<svg className="VLogo" width="32px" height="32px" viewBox="0 0 32 32" version="1.1" >
<title id="title">Voluntarily Logo</title>
<g id="Transparent-V-Black" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
// eslint-disable-next-line max-len
<path
Expand Down
2 changes: 1 addition & 1 deletion client/modules/Showcase/Showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Showcase extends Component {
<div className={styles.container}>
<h1>Typography Elements</h1>

<h1>Heading 1 <small>Subheading</small></h1>
<h1>Heading 1 <small>Ha ha ha</small></h1>
<h2>Heading 2 <small>Subheading</small></h2>
<h3>Heading 3 <small>Subheading</small></h3>
<h4>Heading 4 <small>Subheading</small></h4>
Expand Down
12 changes: 12 additions & 0 deletions docker-compose-ecs-atlas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'
services:
web:
image: 585172581592.dkr.ecr.ap-southeast-1.amazonaws.com/vly1-main-repo:latest
depends_on:
- db
ports:
- "${WEB_PORT:-80}:8000"
environment:
NODE_ENV: production
MONGO_URL: mongodb+srv://vly-client:[email protected]/test?retryWrites=true

19 changes: 19 additions & 0 deletions docker-compose-ecs-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'
services:
web:
image: 585172581592.dkr.ecr.ap-southeast-1.amazonaws.com/vly1-main-repo:latest
depends_on:
- db
ports:
- "${WEB_PORT:-80}:8000"
environment:
NODE_ENV: development
MONGO_URL: mongodb://db:27017/vly1
db:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- dbdata:/data/db
volumes:
dbdata:
19 changes: 19 additions & 0 deletions docker-compose-ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'
services:
web:
image: 585172581592.dkr.ecr.ap-southeast-1.amazonaws.com/vly1-main-repo:latest
depends_on:
- db
ports:
- "${WEB_PORT:-80}:8000"
environment:
NODE_ENV: production
MONGO_URL: mongodb+srv://vly-client:[email protected]/test?retryWrites=true
db:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- dbdata:/data/db
volumes:
dbdata:
2 changes: 1 addition & 1 deletion docker-compose-production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.4'
version: '3'
services:
web:
build:
Expand Down
3 changes: 2 additions & 1 deletion server/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const config = {
mongoURL: process.env.MONGO_URL || 'mongodb://localhost:27017/vly1',
mongoURL: process.env.MONGO_URL || 'mongodb+srv://vly-client:[email protected]/test?retryWrites=true',
// 'mongodb://localhost:27017/vly1',
port: process.env.PORT || 8000,
};

Expand Down
3 changes: 2 additions & 1 deletion server/config/environment/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = {

// MongoDB connection options
mongo: {
uri: process.env.MONGODB_URI ||
uri: process.env.MONGO_URL ||
process.env.MONGODB_URI ||
process.env.MONGOHQ_URL ||
process.env.OPENSHIFT_MONGODB_DB_URL +
process.env.OPENSHIFT_APP_NAME ||
Expand Down

0 comments on commit 885a4e8

Please sign in to comment.