Skip to content

Commit

Permalink
fix(dev): use default init method for localstack
Browse files Browse the repository at this point in the history
  • Loading branch information
mantariksh committed Sep 16, 2020
1 parent 42a8621 commit dfb842d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ EXPOSE 5000
# e.g. chromium when launched to create a new PDF
ENTRYPOINT [ "tini", "--" ]
# Create local S3 buckets before building the app
CMD sh init-localstack.sh && npm run docker-dev
CMD npm run docker-dev
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ services:
environment:
- SERVICES=s3
- DATA_DIR=/tmp/localstack/data
- ATTACHMENT_S3_BUCKET=local-attachment-bucket
- IMAGE_S3_BUCKET=local-image-bucket
- LOGO_S3_BUCKET=local-logo-bucket
volumes:
- './.localstack:/tmp/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
- './docker-entrypoint-initaws.d:/docker-entrypoint-initaws.d'
network_mode: 'service:formsg' # reuse formsg service's network stack so that it can resolve localhost:4566 to localstack:4566

volumes:
Expand Down
6 changes: 6 additions & 0 deletions docker-entrypoint-initaws.d/init-localstack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -x
awslocal s3 mb s3://$IMAGE_S3_BUCKET
awslocal s3 mb s3://$LOGO_S3_BUCKET
awslocal s3 mb s3://$ATTACHMENT_S3_BUCKET
set +x
10 changes: 0 additions & 10 deletions init-localstack.sh

This file was deleted.

0 comments on commit dfb842d

Please sign in to comment.