From 517f81334ebfe8d72ed5808ec025e7ec9dcd489e Mon Sep 17 00:00:00 2001 From: Kevin Szuchet <31735779+kevinszuchet@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:23:31 -0300 Subject: [PATCH] fix: Missing glibc (#29) * fix: Missing glibc using debian slim image * feat: docker compose + Dockerfile using alpine * fix: Delete gcompat * fix: Install libstdc++ and gcompat at the end * chore: Clean up run apk update and add * fix: Avoid using alpine-pkg-glibc * chore: Avoid installing curl --- Dockerfile | 8 +++++--- docker-compose.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index be416c1..120cee7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM node:18-alpine as builderenv +FROM node:18-alpine AS builderenv WORKDIR /app @@ -18,10 +18,12 @@ RUN yarn install --prod --frozen-lockfile FROM node:18-alpine -RUN apk update && apk add --no-cache wget tini +RUN apk update && \ + apk add --no-cache wget tini libstdc++ gcompat && \ + rm -rf /var/cache/apk/* # NODE_ENV is used to configure some runtime options, like JSON logger -ENV NODE_ENV production +ENV NODE_ENV=production ARG COMMIT_HASH=local ENV COMMIT_HASH=${COMMIT_HASH:-local} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..68c619e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,35 @@ +services: + postgres: + image: postgres:latest + container_name: postgres-local + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: social_service_ea + ports: + - '5432:5432' + volumes: + - postgres-data:/var/lib/postgresql/data + + redis: + image: redis:latest + container_name: redis-local + ports: + - '6379:6379' + + app: + image: social-service-ea:local + build: + context: . + dockerfile: Dockerfile + environment: + PG_COMPONENT_PSQL_CONNECTION_STRING: 'postgresql://postgres:postgres@postgres:5432/social_service_ea' + REDIS_HOST: 'redis' + ports: + - '3000:3000' + depends_on: + - postgres + - redis + +volumes: + postgres-data: