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: