This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service: add link env values in docker build args
- Loading branch information
Showing
11 changed files
with
289 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
# sst | ||
.sst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:18-bullseye-slim | ||
ARG SST_RESOURCE_MyBucket | ||
|
||
WORKDIR /app/ | ||
|
||
COPY package.json /app | ||
RUN npm install | ||
|
||
# Ensure linked resources are available at build time | ||
COPY build.mjs /app | ||
RUN node build.mjs | ||
|
||
COPY index.mjs /app | ||
|
||
ENTRYPOINT ["node", "index.mjs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Resource } from "sst"; | ||
|
||
console.log("SDK", Resource.MyBucket.name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import express from "express"; | ||
import { Resource } from "sst"; | ||
|
||
const PORT = 80; | ||
|
||
const app = express(); | ||
|
||
app.get("/", async (req, res) => { | ||
res.send( | ||
JSON.stringify({ | ||
sdk: Resource.MyBucket.name, | ||
env: process.env.SST_RESOURCE_MyBucket, | ||
}) | ||
); | ||
}); | ||
|
||
app.listen(PORT, () => { | ||
console.log(`Server is running on http://localhost:${PORT}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "cluster", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"express": "^4.19.2", | ||
"sst": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* This file is auto-generated by SST. Do not edit. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import "sst" | ||
export {} | ||
declare module "sst" { | ||
export interface Resource { | ||
"MyBucket": { | ||
"name": string | ||
"type": "sst.aws.Bucket" | ||
} | ||
"MyService": { | ||
"service": string | ||
"type": "sst.aws.Service" | ||
"url": string | ||
} | ||
"MyVpc": { | ||
"type": "sst.aws.Vpc" | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
examples/internal/playground/functions/bundled-example/sst-env.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* This file is auto-generated by SST. Do not edit. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import "sst" | ||
export {} | ||
declare module "sst" { | ||
export interface Resource { | ||
"MyBucket": { | ||
"name": string | ||
"type": "sst.aws.Bucket" | ||
} | ||
"MyService": { | ||
"service": string | ||
"type": "sst.aws.Service" | ||
"url": string | ||
} | ||
"MyVpc": { | ||
"type": "sst.aws.Vpc" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
/* This file is auto-generated by SST. Do not edit. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import "sst" | ||
export {} | ||
declare module "sst" { | ||
export interface Resource { | ||
"MyApp": { | ||
"name": string | ||
"type": "sst.aws.Function" | ||
"url": string | ||
} | ||
"MyBucket": { | ||
"name": string | ||
"type": "sst.aws.Bucket" | ||
} | ||
"MyService": { | ||
"service": string | ||
"type": "sst.aws.Service" | ||
"url": string | ||
} | ||
"MyVpc": { | ||
"type": "sst.aws.Vpc" | ||
} | ||
} | ||
} | ||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.