Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dev.docker-compose.yml
- version: "3.7"
- services:
- flyver-backend:
- image: dev-flyver-backend:v1
- build:
- context: .
- dockerfile: dev.Dockerfile
- args:
- POSTGRES_CONNECTION_STRIG: $DATABASE_URL
- ports:
- - "3000:${SERVER_PORT}"
- depends_on:
- - redis
- - postgres
- restart: always
- environment:
- - NODE_ENV=development
- env_file:
- - .env
- - .postgresql.env
- redis:
- image: redis:7.0-rc1-alpine3.15
- restart: always
- command: ["redis-server", "--bind", "redis", "--port", "6379"]
- postgres:
- image: postgres:13
- restart: always
- volumes:
- - postgres-data:/data/postgres
- env_file:
- - .postgresql.env
- healthcheck:
- test: ["CMD-SHELL", "pg_isready"]
- interval: 10s
- timeout: 5s
- retries: 5
- volumes:
- postgres-data:
- // dev.Dockerfile
- # FROM node:14.19.0-alpine3.15 as build_stage
- FROM node:16.14.0-alpine3.15 as build_stage
- # FROM node:16.14.0-stretch-slim
- WORKDIR /app
- # COPY . .
- COPY package*.json ./
- COPY prisma ./prisma/
- RUN NODE_ENV=development npm i
- # RUN NODE_ENV=development npm ci
- # RUN NODE_ENV=development npx yarn install --immutable --immutable-cache --check-cache --frozen-lockfile --inline-builds --peer --json
- COPY . .
- RUN npx prisma generate
- RUN npm run build
- RUN npm prune --production
- # FROM node:14.19.0-alpine3.15 as build_stage
- FROM node:16.14.0-alpine3.15
- # FROM node:16.14.0-stretch-slim
- WORKDIR /app
- # RUN mkdir /app/pgdata
- COPY --from=build_stage /app/node_modules ./node_modules
- COPY --from=build_stage /app/package*.json ./
- COPY --from=build_stage /app/dist ./dist
- CMD [ "npm", "run", "start:prod" ]
- EXPOSE $SERVER_PORT
- // Command I run in the shell:
- $ docker-compose -f dev.docker-compose.yml up --build
Add Comment
Please, Sign In to add comment