ci(docker): changes to dockerfile to make builds faster

This commit is contained in:
Amruth Pillai 2022-03-05 23:18:47 +01:00
parent 37f0ab3bca
commit 00505a9e5d
No known key found for this signature in database
GPG Key ID: E3C57DF9B80855AD
4 changed files with 19 additions and 24 deletions

View File

@ -2,3 +2,4 @@ dist
Dockerfile Dockerfile
node_modules node_modules
.dockerignore .dockerignore
docker-compose.yml

1
.npmrc
View File

@ -1 +0,0 @@
engine-strict=true

View File

@ -4,9 +4,7 @@ RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
WORKDIR /app WORKDIR /app
COPY .npmrc package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
ENV HUSKY 0
RUN pnpm install --frozen-lockfile RUN pnpm install --frozen-lockfile
@ -20,12 +18,9 @@ RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
WORKDIR /app WORKDIR /app
COPY --from=builder /app/package.json . COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
COPY --from=builder /app/pnpm-lock.yaml .
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist
ENV HUSKY 0
RUN pnpm install --frozen-lockfile --prod RUN pnpm install --frozen-lockfile --prod
# Expose App # Expose App

View File

@ -12,22 +12,8 @@ services:
- pgdata:/var/lib/postgresql/data - pgdata:/var/lib/postgresql/data
# Development # Development
app:
build: .
container_name: app
links:
- postgres
ports:
- 3000:3000
- 3100:3100
env_file: .env
environment:
NODE_ENV: development
POSTGRES_HOST: postgres
# Production
# app: # app:
# image: amruthpillai/reactive-resume # build: .
# container_name: app # container_name: app
# links: # links:
# - postgres # - postgres
@ -36,8 +22,22 @@ services:
# - 3100:3100 # - 3100:3100
# env_file: .env # env_file: .env
# environment: # environment:
# NODE_ENV: production # NODE_ENV: development
# POSTGRES_HOST: postgres # POSTGRES_HOST: postgres
# Production
app:
image: reactive-resume
container_name: app
links:
- postgres
ports:
- 3000:3000
- 3100:3100
env_file: .env
environment:
NODE_ENV: production
POSTGRES_HOST: postgres
volumes: volumes:
pgdata: pgdata: