Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9c7b497

Browse files
author
dmitriy
committed
refactored dockerfile
1 parent c00ca45 commit 9c7b497

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

‎docker/development/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ COPY . $APP_HOME
5252
COPY .env.local $APP_HOME/.env
5353

5454
# set working dir
55-
WORKDIR /var/www/laravel
55+
WORKDIR $APP_HOME
5656

5757
# install all PHP dependencies
5858
RUN composer install --no-interaction --no-progress

‎docker/production/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,23 @@ RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
3232

3333
# put apache and php configs for Laravel
3434
COPY ./docker/hosts/laravel.conf /etc/apache2/sites-available/laravel.conf
35-
RUN a2dissite 000-default.conf && a2ensite laravel.conf
35+
COPY ./docker/hosts/laravel-ssl.conf /etc/apache2/sites-available/laravel-ssl.conf
36+
RUN a2dissite 000-default.conf && a2ensite laravel.conf && a2ensite laravel-ssl
3637
COPY ./docker/production/php.ini /usr/local/etc/php/php.ini
3738

39+
# generate certificates. TODO: change it
40+
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=AT/ST=Vienna/L=Vienna/O=Security/OU=Development/CN=example.com"
41+
3842
# enable apache modules
3943
RUN a2enmod rewrite
44+
RUN a2enmod ssl
4045

41-
# copy source files and run composer
46+
# copy source files and config file
4247
COPY . $APP_HOME
48+
COPY .env.prod $APP_HOME/.env
4349

4450
# set working dir
45-
WORKDIR /var/www/laravel
51+
WORKDIR $APP_HOME
4652

4753
# install all PHP dependencies
4854
RUN composer install --no-interaction --no-progress --no-dev

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /