ci(docker): changes to dockerfile to make builds faster
This commit is contained in:
parent
37f0ab3bca
commit
00505a9e5d
|
@ -2,3 +2,4 @@ dist
|
||||||
Dockerfile
|
Dockerfile
|
||||||
node_modules
|
node_modules
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
docker-compose.yml
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue