Skip to content

Commit 794b9d6

Browse files
authored
Merge pull request #113 from jackoturner/copilot/update-deploy-fly-io
Enable Fly.io-compatible runtime and container startup
2 parents 7d12d4f + 0dd6c0c commit 794b9d6

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ COPY . /src
1717
# Expose our application port (3000)
1818
EXPOSE 3000
1919

20-
20+
CMD ["node", "index.js"]

app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ app.post("/api/reviews", (req, res) => {
127127
testDBConnection();
128128

129129
// Server
130-
const PORT = 3000;
130+
const PORT = process.env.PORT || 3000;
131131
app.listen(PORT, "0.0.0.0", () => {
132132
console.log(`Server running on port ${PORT}`);
133133
});

fly.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
app = "softwareengineeringmodulecoursework"
2+
primary_region = "lhr"
3+
4+
[env]
5+
PORT = "3000"
6+
7+
[http_service]
8+
internal_port = 3000
9+
force_https = true
10+
auto_start_machines = true
11+
min_machines_running = 0
12+
processes = ["app"]

0 commit comments

Comments
 (0)