Skip to content

Commit

Permalink
chore: 🐛 generate .env when build image with compose
Browse files Browse the repository at this point in the history
  • Loading branch information
lehuygiang28 committed Jun 29, 2024
1 parent a3b28ab commit 67fd58e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
run: |
touch .env
echo "# .env created" >> .env
echo "# .env created" >> ./apps/fe/.env
echo "# .env created" >> ./apps/be/.env
cat .env
- name: Set COMPOSE_TAG as short commit SHA
Expand Down
6 changes: 0 additions & 6 deletions apps/be/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ RUN yarn workspaces focus --production && yarn cache clean --all

COPY --from=build-stage --chown=node /usr/src/app/dist ./dist

# Just make sure the .env file is existed
RUN mkdir -p /usr/src/app/apps/be && \
# Add new line to the end of the file
echo "" >> /usr/src/app/apps/be/.env && \
echo "# .env created" >> /usr/src/app/apps/be/.env

ENV NODE_ENV production

CMD ["node", "dist/apps/be/main"]
6 changes: 0 additions & 6 deletions apps/fe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ WORKDIR /usr/src/app

COPY --from=build-stage --chown=node /usr/src/app/dist/apps/fe/.next/standalone ./dist/apps/fe/.next/standalone

# Just make sure the .env file is existed
RUN mkdir -p /usr/src/app/apps/fe && \
# Add new line to the end of the file
echo "" >> /usr/src/app/apps/fe/.env && \
echo "# .env created" >> /usr/src/app/apps/fe/.env

ENV PORT 3000
ENV HOST 0.0.0.0
ENV NEXT_TELEMETRY_DISABLED 1
Expand Down

0 comments on commit 67fd58e

Please sign in to comment.