From e1f7404c8d64283488b62b00f30bacde6e692051 Mon Sep 17 00:00:00 2001 From: iamBadgers Date: Sun, 1 Jun 2025 22:31:51 -0700 Subject: [PATCH] update compose to link memcached correctly --- Dockerfile | 3 ++- backend/src/app.ts | 4 +++- docker-compose.yaml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6fff9d..d4c2fcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,8 @@ WORKDIR loader EXPOSE 3001 ENV NODE_ENV=production +ENV MEMCACHE_ADDR="localhost:11211" WORKDIR /srv/cprush-stats RUN npm install -CMD ["node", "app.js"] \ No newline at end of file +CMD ["sh", "-c", "node app.js -m $MEMCACHE_ADDR"] \ No newline at end of file diff --git a/backend/src/app.ts b/backend/src/app.ts index dd6ea8c..10db88a 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -34,5 +34,7 @@ app.use('/', (req, res) => { app.listen(port, async () => { await database.authenticate() - return console.log(`Express is listening at http://localhost:${port}`) + console.log(`Using memcache at ${memcache_addr}`) + console.log(`Express is listening at http://localhost:${port}`) + return }) diff --git a/docker-compose.yaml b/docker-compose.yaml index 91bc19c..6953aec 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,6 +9,8 @@ services: image: potato networks: - cprush-net + environment: + - MEMCACHE_ADDR=memcache:11211 ports: - 3001:3001 depends_on: