Skip to content

Commit

Permalink
fix: separate prod and dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rise-erpelding committed Sep 28, 2023
1 parent ad883e0 commit f8d8fba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: Install npm dependencies
run: npm ci

- name: Install custom plugin npm dependencies
run: npm run plugins:install

- name: Install PHP dependencies with Composer
uses: php-actions/composer@v6
with:
Expand Down
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-apache-buster
FROM php:8.1-apache-buster as dev

LABEL org.opencontainers.image.source=https://github.com/sparkbox/sparkpress-wordpress-starter

Expand Down Expand Up @@ -37,3 +37,11 @@ RUN find /var/www/ -type f -exec chmod 644 {} \;
# make the linters executable so we can run them from containers
RUN chmod +x vendor/bin/phpcs
RUN chmod +x vendor/bin/twigcs

FROM dev as prod

COPY theme /var/www/html/wp-content/themes/sparkpress-theme
COPY plugins/example-blocks /var/www/html/wp-content/plugins/example-blocks
COPY wp-configs/wp-config.php /var/www/html/wp-config.php
COPY wp-configs/php.ini /var/www/html/php.ini
COPY wp-configs/.htaccess /var/www/html/.htaccess
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: '3.7'

services:
web:
build: .
build:
context: .
target: dev
container_name: sparkpress
ports:
- '8000:80'
Expand Down

0 comments on commit f8d8fba

Please sign in to comment.