File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1111 }
1212 },
1313 "runArgs" : [" --hostname" ," ${localEnv:OAUTH_ASTRO_CONTAINER_HOSTNAME:astro.dev}" ],
14+ "containerEnv" : { "PORT" : " 8080" },
1415 "customizations" : {
1516 "vscode" : {
1617 "extensions" : [
2122 " donjayamanne.githistory"
2223 ]
2324 }
24- }
25+ },
2526
2627 // Features to add to the dev container. More info: https://containers.dev/features.
2728 // "features": {},
2829
2930 // Use 'forwardPorts' to make a list of ports inside the container available locally.
30- // "forwardPorts": [],
31+ "forwardPorts" : [8080 ],
32+ "portsAttributes" : {
33+ "8080" : {
34+ "label" : " FrontendToBackend" ,
35+ "requireLocalPort" : true ,
36+ "elevateIfNeeded" : true
37+ }
38+ }
3139
3240 // Use 'postCreateCommand' to run commands after the container is created.
3341 // "postCreateCommand": "yarn install",
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import tailwind from '@astrojs/tailwind';
66
77
88const HOSTNAME = process . env . HOSTNAME
9+ const PORT = parseInt ( process . env . PORT )
910
1011const options = {
1112 key : fs . readFileSync ( "./private/server.key" ) ,
@@ -15,7 +16,8 @@ const options = {
1516// https://astro.build/config
1617export default defineConfig ( {
1718 output : 'server' ,
18- vite : { server : { https : options } } ,
19+ vite : { server : { https : options , port : PORT } } ,
20+ server : { port : PORT } ,
1921 adapter : node ( { mode :'standalone' } ) ,
2022 site : `https://${ HOSTNAME } }` ,
2123 integrations : [ tailwind ( ) ] ,
Original file line number Diff line number Diff line change 33 "type" : " module" ,
44 "version" : " 0.0.1" ,
55 "scripts" : {
6- "dev" : " astro dev" ,
7- "start" : " astro dev" ,
6+ "dev" : " astro dev --host " ,
7+ "start" : " astro dev --host " ,
88 "build" : " astro check && astro build" ,
99 "preview" : " astro preview" ,
1010 "astro" : " astro" ,
11- "ssr" : " SERVER_KEY_PATH=./private/server.key SERVER_CERT_PATH=./private/server.crt HOST=127.0.0.1 PORT=4321 node ./dist/server/entry.mjs"
11+ "ssr" : " SERVER_KEY_PATH=./private/server.key SERVER_CERT_PATH=./private/server.crt HOST=127.0.0.1 PORT=$PORT node ./dist/server/entry.mjs"
1212 },
1313 "dependencies" : {
1414 "@astrojs/check" : " ^0.9.3" ,
You can’t perform that action at this time.
0 commit comments