Skip to content

Commit

Permalink
Updated Docker configurations
Browse files Browse the repository at this point in the history
1. Added Node definition to Docker Image
2. Added reverse proxy so we can launch the site using http://userfrosting.localhost instead of using http://localhost::port
  • Loading branch information
ssnukala committed Mar 26, 2020
1 parent 6d19707 commit 8646d25
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
31 changes: 29 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
restart: unless-stopped
tty: true
build:
context: docker/app
context: ./docker/app
environment:
- DB_DRIVER=mysql
- DB_HOST=ufmysql
Expand All @@ -17,8 +17,19 @@ services:
- ./docker/app/php/custom.ini:/usr/local/etc/php/conf.d/custom.ini
networks:
- backend

nginx-proxy:
image: jwilder/nginx-proxy
ports:
- 80:80
- 443:443
networks:
- reverse-proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
nginx:
environment:
VIRTUAL_HOST: userfrosting.localhost
VIRTUAL_PORT: 80
restart: unless-stopped
tty: true
ports:
Expand All @@ -34,6 +45,7 @@ services:
networks:
- frontend
- backend
- reverse-proxy

ufmysql:
image: mysql:5.7
Expand All @@ -48,6 +60,20 @@ services:
- 8593:3306
volumes:
- userfrosting-db:/var/lib/mysql
composer:
image: "composer"
volumes:
- .:/app
working_dir: /app
command: -V
node:
image: node:alpine
build:
context: ./docker/node
volumes:
- .:/app
working_dir: /app/build
command: npm run uf-assets-install

volumes:
userfrosting-db:
Expand All @@ -56,3 +82,4 @@ volumes:
networks:
frontend:
backend:
reverse-proxy:
3 changes: 3 additions & 0 deletions docker/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM node:alpine
RUN apk --update add --no-cache git
RUN echo '{ "allow_root": true }' > /root/.bowerrc

0 comments on commit 8646d25

Please sign in to comment.