diff --git a/Dockerfile b/Dockerfile index aa81eb1..d38e529 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM php:8.1-apache +ENV NODE_ENV development + ENV PGHOST localhost ENV POSTGRES_DB pgsql ENV POSTGRES_USER postgres @@ -57,5 +59,12 @@ RUN apt-get autoclean EXPOSE 80 5432 WORKDIR /var/www/html/public + +# install project dependencies +RUN npm install + +# build app for production with minification +RUN npm run build + # CMD ["/usr/local/bin/start"] diff --git a/start.sh b/start.sh index 6a237d3..2287646 100755 --- a/start.sh +++ b/start.sh @@ -1,8 +1,5 @@ #!/bin/sh -npm i -node --max_old_space_size=300 /usr/local/bin/npm run build - service postgresql restart sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '12345678';" sudo -u postgres psql -c "create database example_app;"