diff --git a/.gitignore b/.gitignore index 1437c53..260a2d5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ yarn-error.log* # vercel .vercel + +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f1c8d02..a269968 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ -FROM node AS deps +FROM node:12-alpine AS deps WORKDIR /app COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile -FROM node AS builder +FROM node:12-alpine AS builder WORKDIR /app COPY . . COPY --from=deps /app/node_modules ./node_modules ENV NEXT_TELEMETRY_DISABLED 1; RUN yarn build && yarn install --production --ignore-scripts --prefer-offline -FROM node AS runner +FROM node:12-alpine AS runner WORKDIR /app ENV NODE_ENV production @@ -30,4 +30,4 @@ USER nextjs EXPOSE 3000 -CMD ["yarn", "start"] \ No newline at end of file +CMD ["yarn", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bef2579 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + app: + container_name: portfolio + build: . + env_file: .env + +networks: + default: + external: + name: nginx \ No newline at end of file