Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: '3.8'
services:
api:
container_name: ionicapp_api
restart: unless-stopped
depends_on:
- postgres
build:
Expand All @@ -21,6 +20,24 @@ services:
&& rm -rf dist
&& npm run start:debug"

api-run:
container_name: ionicapp_api_run
restart: unless-stopped
depends_on:
- postgres
- redis
build:
context: docker/api
dockerfile: ./Dockerfile
user: "node"
tty: true
volumes:
- ./:/app
ports:
- ${PORT}:3000
- ${DEBUG_PORT}:9229
command: ["npm", "run", "start:prod"]

postgres:
container_name: ionicapp_postgres
restart: unless-stopped
Expand Down
4 changes: 2 additions & 2 deletions infra/lib/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ export class InfraStack extends cdk.Stack {
`echo "BCRYPT_SALT_ROUNDS=8" >> .env`,

// Start Docker Compose
'sudo -u ec2-user /usr/local/bin/docker-compose up api postgres redis -d',
'sudo -u ec2-user /usr/local/bin/docker-compose up api-run postgres redis -d',

// Wait for services to start, then run migrations
'sleep 30',
'sudo -u ec2-user /usr/local/bin/docker-compose exec -T api npm run migration:run',
'sudo -u ec2-user /usr/local/bin/docker-compose exec -T api-run npm run migration:run',
);

const keyPair = new ec2.CfnKeyPair(this, `${projectName}KeyPair`, {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionicapp",
"version": "0.0.4",
"version": "0.0.5",
"description": "",
"author": "",
"private": true,
Expand Down
Loading