Skip to content

Commit f678abe

Browse files
committed
feat(localstack) configure localstack to the project
1 parent cb359e0 commit f678abe

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ services:
4040
- "127.0.0.1:4566:4566" # LocalStack Gateway
4141
- "127.0.0.1:4510-4559:4510-4559" # external services port range
4242
environment:
43-
- DEBUG=${DEBUG-}
43+
- DEBUG=1
4444
- AWS_DEFAULT_REGION=sa-east-1
45+
- PORT_WEB_UI=8082
46+
- HOSTNAME_EXTERNAL=localhost
4547
- AWS_ACCESS_KEY_ID=fakeAccessKeyId
4648
- AWS_SECRET_ACCESS_KEY=fakeSecretAccessKey
47-
- AKID=fakeAccessKeyId
4849
- DEFAULT_REGION=sa-east-1
4950
- DOCKER_HOST=unix:///var/run/docker.sock
5051
- SREVICES=s3,sns,sqs,ses
5152
- EDGE_PORT=4566
52-
- LOCALSTACK_API_KEY=3oGpLxt9DD
5353
volumes:
5454
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
5555
- "/var/run/docker.sock:/var/run/docker.sock"

src/api/modules/v1/components/aws.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { ApiFactory } from "https://deno.land/x/[email protected]/client/mod.ts";
12
import { CreateBucketOutput, CreateBucketRequest, PutObjectOutput } from "https://deno.land/x/[email protected]/services/s3/structs.ts";
23
import { S3, GetObjectOutput } from "https://deno.land/x/[email protected]/services/s3/mod.ts";
34
import { awsS3Config } from "../../../../common/aws.config.ts";
45
import { env } from "../../../../common/env.config.ts";
5-
import { ApiFactory } from "https://deno.land/x/[email protected]/client/mod.ts";
66
import { log } from "../../../../common/logger.ts";
77

88
class SimpleCloudStorage {
@@ -117,13 +117,15 @@ await new SimpleCloudStorage(
117117
new ApiFactory({
118118
region: awsS3Config.region,
119119
credentials: awsS3Config,
120+
fixedEndpoint: 'http://localhost:4566'
120121
}),
121122
).init();
122123

123124
export default new SimpleCloudStorage(
124125
new S3(new ApiFactory({
125126
region: awsS3Config.region,
126127
credentials: awsS3Config,
128+
fixedEndpoint: 'http://localhost:4566'
127129
}
128130
)),
129131
new ApiFactory({

src/common/aws.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { CreateBucketRequest } from "https://deno.land/x/[email protected]/services/s3/structs.ts";
21
import { env } from "./env.config.ts"
32

43
export const awsS3Config = {

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { log } from "./common/logger.ts";
22
import { env } from "./common/env.config.ts"
33
import app from "./main.ts";
44

5-
app.listen({ port: env.PORT });
5+
app.listen({ port: 5002 });
66
app.addEventListener("listen", ({ hostname, port, secure }) => {
77
log.info(`Database: ${env.MYSQL_DATABASE_NAME}`);
88
log.success(`Server is listening on ${secure ? "https": "http"}://${hostname}:${port}`);

0 commit comments

Comments
 (0)