Skip to content

Commit

Permalink
Feature/deploy self host (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
owalid committed Oct 18, 2023
1 parent afecd0a commit 85a9d7f
Show file tree
Hide file tree
Showing 5 changed files with 11,006 additions and 10,638 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy api to scaleway.


# Run workflow on every push to master branch.
on:
push:
branches: [main]

# Your workflows jobs.
jobs:
deploy_scw:
runs-on: ubuntu-latest
steps:
# Check-out your repository.
- name: Checkout
uses: actions/checkout@v2

- name: Login to scaleway
run: docker login rg.fr-par.scw.cloud/my-services -u nologin --password-stdin <<< ${{ secrets.SCW_SECRET_KEY }}

- name: Docker build
run: docker build -t adaptaviz-fr:latest -f Dockerfile.prod .

- name: Docker tag
run: docker tag adaptaviz-fr:latest rg.fr-par.scw.cloud/my-services/adaptaviz-fr:latest

- name: Docker push in namespace
run: docker push rg.fr-par.scw.cloud/my-services/adaptaviz-fr:latest
15 changes: 15 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint

on: ['pull_request']
jobs:
js-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependecies
run: yarn install --immutable --immutable-cache --check-cache

- name: Run ESLint
run: yarn run lint
28 changes: 28 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:17.2-alpine

RUN apk update

ARG user=app_user
ARG home=/home/$user
RUN mkdir -p $home
RUN addgroup -S app_group && adduser -S app_user -G app_group
WORKDIR $home

USER $user

COPY --chown=$user . $home

RUN rm -rf /home/app/score

ENV HOST 0.0.0.0
ENV NUXT_HOST 0.0.0.0
ENV NODE_OPTIONS --max-old-space-size=5120 --openssl-legacy-provider
ENV NPM_CONFIG_PRODUCTION false
ENV NUXT_BASE_API_URL https://www.adaptaviz.fr/api

RUN npm install
RUN npm run build

USER $user

CMD ["npm", "start"]
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,20 @@
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/pwa": "^3.3.5",
"chroma-js": "^2.1.2",
"color": "^4.1.0",
"colorless-core": "^1.1.0",
"core-js": "^3.15.1",
"cors": "^2.8.5",
"express": "^4.17.1",
"helmet": "^4.6.0",
"helmet": "^6.0.0",
"leaflet": "^1.7.1",
"lodash": "^4.17.21",
"nuxt": "^2.15.7",
"nuxt-webfontloader": "^1.1.0",
"sass-loader": "10.1.1",
"vue": "^2.7.10",
"vue-server-renderer": "^2.7.10",
"vue-template-compiler": "^2.7.10",
"vue2-leaflet": "^2.7.1",
"vuetify": "2.5.14",
"webpack": "4.46.0"
"vuetify": "2.5.5"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/core": "^7.14.7",
"@babel/eslint-parser": "^7.14.7",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
Expand Down
Loading

0 comments on commit 85a9d7f

Please sign in to comment.