Skip to content

Commit

Permalink
chore: exclude .env from prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Aug 29, 2024
1 parent b5473d6 commit 56b691b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
15 changes: 10 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# 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*
**/.eslintrc
**/.gitattributes
**/.gitignore
**/.styleci.yml
**/*.md
**/*.xml
**/bin
**/node_modules
**/*.xml
**/*.md
**/phpstan.neon
**/tests
**/vendor
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# CHANGELOG

## Next Release
## v0.10.0 (2024-08-29)

- Adds `larastan`
- Excludes `.env` file from prod build
- Bumps mariadb from `11.3.2` to `11.4.3`

## v0.9.0 (2024-06-10)

Expand Down
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.laravel-template.rule=Host(`laravel-template.com`) || Host(`www.laravel-template.com`)'
- 'traefik.http.routers.laravel-template.tls=true'
- 'traefik.http.routers.laravel-template.tls.certresolver=letsencrypt'
depends_on:
laravel-template-db:
condition: service_healthy
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ services:
- traefik
- laravel-template
labels:
- traefik.enable=true
- 'traefik.enable=true'
- 'traefik.docker.network=traefik'
env_file:
- src/.env
laravel-template-db:
image: 'mariadb:11.3.2'
image: 'mariadb:11.4.3'
restart: always
volumes:
- database-data:/var/lib/mysql
Expand Down

0 comments on commit 56b691b

Please sign in to comment.