From 8b84baf6b5fe23bf4205c8edc327df52c479d6f3 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:45:51 -0600 Subject: [PATCH] remove files --- docker-compose.dev.yml | 33 -------------- docker-compose.prod-without-multistage.yml | 24 ----------- next-app/dev.Dockerfile | 32 -------------- next-app/prod-without-multistage.Dockerfile | 48 --------------------- 4 files changed, 137 deletions(-) delete mode 100644 docker-compose.dev.yml delete mode 100644 docker-compose.prod-without-multistage.yml delete mode 100644 next-app/dev.Dockerfile delete mode 100644 next-app/prod-without-multistage.Dockerfile diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml deleted file mode 100644 index 747e9c1..0000000 --- a/docker-compose.dev.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: "3" - -services: - next-app: - container_name: next-app - build: - context: ./next-app - dockerfile: dev.Dockerfile - - # Set environment variables directly in the docker-compose file - environment: - ENV_VARIABLE: ${ENV_VARIABLE} - NEXT_PUBLIC_ENV_VARIABLE: ${NEXT_PUBLIC_ENV_VARIABLE} - - # Set environment variables based on the .env file - env_file: - - .env - volumes: - - ./next-app/src:/app/src - - ./next-app/public:/app/public - restart: always - ports: - - 3000:3000 - networks: - - my_network - - # Add more containers below (nginx, postgres, etc.) - -# Define a network, which allows containers to communicate -# with each other, by using their container name as a hostname -networks: - my_network: - external: true diff --git a/docker-compose.prod-without-multistage.yml b/docker-compose.prod-without-multistage.yml deleted file mode 100644 index 908347c..0000000 --- a/docker-compose.prod-without-multistage.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3" - -services: - next-app: - container_name: next-app - build: - context: ./next-app - dockerfile: prod-without-multistage.Dockerfile - args: - ENV_VARIABLE: ${ENV_VARIABLE} - NEXT_PUBLIC_ENV_VARIABLE: ${NEXT_PUBLIC_ENV_VARIABLE} - restart: always - ports: - - 3000:3000 - networks: - - my_network - - # Add more containers below (nginx, postgres, etc.) - -# Define a network, which allows containers to communicate -# with each other, by using their container name as a hostname -networks: - my_network: - external: true diff --git a/next-app/dev.Dockerfile b/next-app/dev.Dockerfile deleted file mode 100644 index d884b71..0000000 --- a/next-app/dev.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM node:18-alpine - -WORKDIR /app - -# Install dependencies based on the preferred package manager -COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ -RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ - elif [ -f package-lock.json ]; then npm ci; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \ - # Allow install without lockfile, so example works even without Node.js installed locally - else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \ - fi - -COPY src ./src -COPY public ./public -COPY next.config.js . -COPY tsconfig.json . - -# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry -# Uncomment the following line to disable telemetry at run time -# ENV NEXT_TELEMETRY_DISABLED 1 - -# Note: Don't expose ports here, Compose will handle that for us - -# Start Next.js in development mode based on the preferred package manager -CMD \ - if [ -f yarn.lock ]; then yarn dev; \ - elif [ -f package-lock.json ]; then npm run dev; \ - elif [ -f pnpm-lock.yaml ]; then pnpm dev; \ - else npm run dev; \ - fi diff --git a/next-app/prod-without-multistage.Dockerfile b/next-app/prod-without-multistage.Dockerfile deleted file mode 100644 index 4be3076..0000000 --- a/next-app/prod-without-multistage.Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM node:18-alpine - -WORKDIR /app - -# Install dependencies based on the preferred package manager -COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ -# Omit --production flag for TypeScript devDependencies -RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ - elif [ -f package-lock.json ]; then npm ci; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \ - # Allow install without lockfile, so example works even without Node.js installed locally - else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \ - fi - -COPY src ./src -COPY public ./public -COPY next.config.js . -COPY tsconfig.json . - -# Environment variables must be present at build time -# https://github.com/vercel/next.js/discussions/14030 -ARG ENV_VARIABLE -ENV ENV_VARIABLE=${ENV_VARIABLE} -ARG NEXT_PUBLIC_ENV_VARIABLE -ENV NEXT_PUBLIC_ENV_VARIABLE=${NEXT_PUBLIC_ENV_VARIABLE} - -# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry -# Uncomment the following line to disable telemetry at build time -# ENV NEXT_TELEMETRY_DISABLED 1 - -# Note: Don't expose ports here, Compose will handle that for us - -# Build Next.js based on the preferred package manager -RUN \ - if [ -f yarn.lock ]; then yarn build; \ - elif [ -f package-lock.json ]; then npm run build; \ - elif [ -f pnpm-lock.yaml ]; then pnpm build; \ - else npm run build; \ - fi - -# Start Next.js based on the preferred package manager -CMD \ - if [ -f yarn.lock ]; then yarn start; \ - elif [ -f package-lock.json ]; then npm run start; \ - elif [ -f pnpm-lock.yaml ]; then pnpm start; \ - else npm run start; \ - fi