Skip to content

Commit

Permalink
fix(docker): ci build image
Browse files Browse the repository at this point in the history
  • Loading branch information
pahaz committed May 11, 2024
1 parent f14257e commit fec5bea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
**/.turbo
**/docs
**/.config
**/.yarn
**/.cache
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,29 @@ RUN set -ex \
# Build container
FROM base AS build
WORKDIR /home/app

RUN echo "# Build time .env config!" >> /home/app/.env && \
echo "COOKIE_SECRET=undefined" >> /home/app/.env && \
echo "DATABASE_URL=undefined" >> /home/app/.env && \
echo "NODE_ENV=production" >> /home/app/.env

COPY package*.json ./
COPY ./yarn.lock ./yarn.lock
COPY ./.yarn ./.yarn
COPY ./.yarnrc.yml ./.yarnrc.yml

# Cache packages!
RUN set -ex && \
RUN set -ex \
&& corepack enable \
&& yarn set version stable \
&& yarn install
&& yarn install --immutable

ADD --chown=app:app . /home/app

RUN set -ex && \
yarn build && \
yarn cache clean && \
rm -rf /home/app/.env && \
rm -rf /home/app/.config && \
rm -rf /home/app/.yarn && \
rm -rf /home/app/.cache && \
ls -lah /home/app/

Expand Down

0 comments on commit fec5bea

Please sign in to comment.