Skip to content
Merged

fix #15

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
8 changes: 4 additions & 4 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ jobs:
"cd /var/www/app",
"aws s3 cp s3://'"$CODE_BUCKET"'/'"$FILE_NAME"' app.zip --region '"$REGION"'",
"sudo -u ec2-user unzip -o app.zip",
"sleep 10",
"sudo -u ec2-user /usr/local/bin/docker-compose up api-run postgres redis -d --build",
"sleep 10",
"sudo -u ec2-user /usr/local/bin/docker-compose exec -T api-run npm run migration:run"
"sleep 15",
"sudo -u ec2-user /usr/local/bin/docker-compose -f docker-compose-dev.yml restart api-run postgres redis -d",
"sleep 15",
"sudo -u ec2-user /usr/local/bin/docker-compose -f docker-compose-dev.yml exec -T api-run npm run migration:run"
]' \
--region "$REGION" \
--query "Command.CommandId" \
Expand Down
18 changes: 0 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ 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
7 changes: 5 additions & 2 deletions infra/lib/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,11 @@ export class InfraStack extends cdk.Stack {
`echo "JWT_REFRESH_SECRET_KEY=$JWT_REFRESH_SECRET_KEY" >> .env`,
`echo "BCRYPT_SALT_ROUNDS=8" >> .env`,

// Start Docker Compose
'sudo -u ec2-user /usr/local/bin/docker-compose up api-run postgres redis -d',
// Build app
'sudo -u ec2-user /usr/local/bin/docker-compose -f docker-compose-dev.yml up api-build',

// Start services
'sudo -u ec2-user /usr/local/bin/docker-compose -f docker-compose-dev.yml up api-run postgres redis -d',

// Wait for services to start, then run migrations
'sleep 30',
Expand Down
Loading