diff --git a/.env b/.env index 2b5fddd..484b163 100644 --- a/.env +++ b/.env @@ -3,6 +3,8 @@ POSTGRES_PASSWORD=irina76 POSTGRES_DB=imk_db DATABASE_URL="postgresql://postgres:postgres@postgres:5432/imk_db?schema=public" #DATABASE_URL="postgresql://root:irina76@localhost:5432/imk?schema=public" +REDIS_PASSWORD=somerandompassword + JWT_SECRET=some-secret AWS_REGION=EU2 AWS_ACCESS_KEY_ID=4d2f5655369a02100375e3247d7e1fe6 diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/backend/.env b/backend/.env index e29a2e4..967667d 100644 --- a/backend/.env +++ b/backend/.env @@ -2,6 +2,10 @@ POSTGRES_USER=root POSTGRES_PASSWORD=irina76 POSTGRES_DB=imk_db DATABASE_URL="postgresql://postgres:postgres@postgres:5432/imk_db?schema=public" + +REDIS_PASSWORD=somerandompassword + + JWT_SECRET=some-secret AWS_REGION=EU2 AWS_ACCESS_KEY_ID=4d2f5655369a02100375e3247d7e1fe6 diff --git a/backend/Dockerfile b/backend/Dockerfile index f055f1a..717689e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -32,15 +32,16 @@ RUN apk add --no-cache curl wget # Copy package files COPY package*.json ./ - +COPY prisma ./prisma/ # Install dependencies RUN npm install # Copy prisma schema -COPY prisma ./prisma/ +# COPY prisma ./prisma/ # Generate Prisma client RUN npx prisma generate +RUN npx prisma migrate deploy # Copy source code COPY . . @@ -51,6 +52,8 @@ RUN npm run build # Expose port EXPOSE 3000 +# ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /wait-for-it.sh +# RUN chmod +x /wait-for-it.sh # Add healthcheck HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD wget -q --spider http://localhost:3000/health || exit 1 diff --git a/backend/prisma/init.sql b/backend/prisma/init.sql new file mode 100644 index 0000000..a6567fc --- /dev/null +++ b/backend/prisma/init.sql @@ -0,0 +1 @@ +CREATE DATABASE imk_db;