Created
June 26, 2019 04:10
-
-
Save wilcorrea/f4d0598bd68f1f5f12590b47ea628b95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~> docker-compose.yml | |
| version: '3' | |
| services: | |
| # Quasar Framework service to provide app | |
| my-app: | |
| container_name: my-app | |
| build: .docker/quasar | |
| user: node | |
| image: my-app/quasar:1.0.0-rc.2 | |
| working_dir: /var/www/app | |
| command: sh /var/www/app/quasar.command.sh | |
| volumes: | |
| - .:/var/www/app | |
| - ./.bin:/home/node/bin | |
| ports: | |
| - 8000:8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~> .docker/quasar/Dockerfile | |
| FROM node:10-alpine | |
| RUN apk --update add openssh-client git | |
| # https://www.npmjs.com/package/@vue/cli | |
| # https://www.npmjs.com/package/@vue/cli-init | |
| RUN npm install --global\ | |
| vue-cli\ | |
| @vue/[email protected]\ | |
| @vue/[email protected] | |
| # https://www.npmjs.com/package/@quasar/cli | |
| # https://www.npmjs.com/package/http-server | |
| RUN npm install --global\ | |
| @quasar/[email protected]\ | |
| [email protected] | |
| RUN mkdir /home/node/app | |
| USER root | |
| # VOLUME [ "/home/node/app" ] | |
| WORKDIR /home/node/app | |
| CMD /bin/sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker build -t my-app/quasar:1.0.0-rc.2 .docker/quasar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ~> quasar.command.sh | |
| if [[ ! -d /var/www/app/node_modules ]]; then | |
| echo "~> installing dependencies" | |
| if [[ which yarn ]]; then | |
| yarn install | |
| else | |
| if [[ which npm ]]; then | |
| npm install | |
| fi | |
| fi | |
| fi | |
| if [[ ! -f /home/node/bin/node && -f /usr/local/bin/node ]]; then | |
| echo "~> expose bin" | |
| cp /usr/local/bin/node /home/node/bin/node | |
| echo "~> fix permissions" | |
| chown -R node:node . | |
| fi | |
| echo "Details: '$(pwd)' | '$(quasar -v)'" | |
| echo "~> starting dev" | |
| quasar dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment