Skip to content

Commit

Permalink
chore: exclude .env file from prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Aug 29, 2024
1 parent f90b2f1 commit 26b3bb5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
14 changes: 9 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Exclude everything we won't need for a production build
# NOTE: These will get volumed during development but excluded in production
# Exclude everything we won't need for a production build.
# NOTE: These will be volumed during development but excluded in production
# unless explicitly put there by the build process.
**/.DS_Store
**/.env-example
**/.editorconfig
**/.env*
**/.gitattributes
**/.gitignore
**/.styleci.yml
**/*.md
**/*.xml
**/bin
**/node_modules
**/*.xml
**/*.md
**/phpstan.neon
**/tests
**/vendor
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ RUN if [ ! -z "$PROD" ]; then \
# Setup prod env
composer install -q --no-ansi --no-interaction --no-scripts --no-plugins --no-progress --prefer-dist --optimize-autoloader --no-dev \
&& npm install -s --omit=dev \
&& npm run build \
&& php artisan optimize; \
&& npm run build; \
# Setup dev env
else \
composer install \
&& npm install \
&& php artisan optimize:clear; \
&& npm install; \
fi \
# Setup shared env
&& php artisan storage:link

CMD sh -c "$(if [ ! -z "$PROD" ]; then php artisan optimize; else php artisan optimize:clear; fi)"
1 change: 0 additions & 1 deletion docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ services:
labels:
- 'traefik.http.routers.glass.rule=Host(`blog.justinpaulhammond.com`) || Host(`www.blog.justinpaulhammond.com`)'
- 'traefik.http.routers.glass.tls=true'
- 'traefik.http.routers.glass.tls.certresolver=letsencrypt'
depends_on:
glass-db:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- traefik
- glass
labels:
- traefik.enable=true
- 'traefik.enable=true'
- 'traefik.docker.network=traefik'
env_file:
- src/.env
Expand Down

0 comments on commit 26b3bb5

Please sign in to comment.