Skip to content

Commit d3c0854

Browse files
authored
Development Docker updates (#443)
1 parent 691a1f8 commit d3c0854

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

backend/Dockerfile.dev

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
FROM webdevops/php-nginx:8.2-alpine
1+
FROM serversideup/php:8.3-fpm-nginx-alpine
22

3-
WORKDIR /app
3+
ENV PHP_OPCACHE_ENABLE=1
4+
ENV NGINX_WEBROOT=/var/www/html/public
45

5-
COPY . /app
6+
WORKDIR /var/www/html
67

7-
ENV WEB_DOCUMENT_ROOT /app/public
8+
RUN mkdir -p /var/www/html/storage /var/www/html/bootstrap/cache \
9+
&& chown -R www-data:www-data /var/www/html
810

9-
ENV PHP_DISMOD=ioncube,pdo_sqlsrv,sqlsrv,pdo_mysql,mysqli,mysqlnd,pdo_sqlite,mysqlnd,mongodb,memcached
11+
COPY --chown=www-data:www-data . /var/www/html
1012

11-
COPY ./docker/supervisord/syslog.conf /opt/docker/etc/supervisor.d/syslog.conf
13+
# Switch to root user to install PHP extensions
14+
USER root
15+
RUN install-php-extensions intl
16+
USER www-data
1217

13-
RUN chown -R application:application /app \
14-
&& mkdir -p /app/storage \
15-
&& chmod -R 755 /app/storage \
16-
&& mkdir -p /app/bootstrap/cache \
17-
&& chmod -R 775 /app/bootstrap/cache
18-
19-
EXPOSE 80 443
20-
21-
CMD ["supervisord"]
18+
RUN chmod -R 755 /var/www/html/storage \
19+
&& chmod -R 775 /var/www/html/bootstrap/cache

docker/development/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ APP_KEY=base64:z7qfYEwsFdTn6zMCYwgSwDoWZlk6SuKU54+woXYNHlk=
44
APP_DEBUG=true
55

66
API_URL_CLIENT=https://localhost:8443/api
7-
API_URL_SERVER=http://backend:80
7+
API_URL_SERVER=http://backend:8080
88
STRIPE_PUBLIC_KEY=pk_test_XX
99
FRONTEND_URL=https://localhost:8443
1010

docker/development/docker-compose.dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ services:
77
ports:
88
- "1234:80"
99
volumes:
10-
- ./../../backend:/app
11-
- ./../../backend/storage:/app/storage
12-
- ./../../backend/bootstrap/cache:/app/bootstrap/cache
10+
- ./../../backend:/var/www/html
11+
- ./../../backend/storage:/var/www/html/storage
12+
- ./../../backend/bootstrap/cache:/var/www/html/bootstrap/cache
1313
environment:
1414
APP_ENV: '${APP_ENV:-local}'
1515
APP_KEY: '${APP_KEY}'

docker/development/nginx/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ http {
2020
}
2121

2222
location /api/ {
23-
proxy_pass http://backend:80/;
23+
proxy_pass http://backend:8080/;
2424
proxy_set_header Host $host;
2525
proxy_set_header X-Real-IP $remote_addr;
2626
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

docker/development/start-dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fi
8585

8686
$COMPOSE_CMD exec backend php artisan key:generate
8787
$COMPOSE_CMD exec backend php artisan migrate
88-
$COMPOSE_CMD exec backend chmod -R 775 /app/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer
88+
$COMPOSE_CMD exec backend chmod -R 775 /var/www/html/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer
8989
$COMPOSE_CMD exec backend php artisan storage:link
9090

9191
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)