Skip to content

Commit

Permalink
Merge branch 'master' into 709-6-Toggle-In-TopMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
ogerly authored Jul 2, 2024
2 parents 44a60c2 + e90affd commit 8c6628b
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ npm run dev
| Endpoint | Description |
| -------------------------------------------------------------------- | -------------------------- |
| [http://localhost:3306](http://localhost:3306) | MySQL Database |
| [http://localhost:3000](http://localhost:3000) | Presenter |
| [http://localhost:3000](http://localhost:3001) | Presenter |
| [http://localhost:8081](http://localhost:8081) | Presenter Documentation |
| [http://localhost:6006](http://localhost:6006) | Presenter Storybook |
| [http://localhost:3001](http://localhost:3001) | Frontend |
| [http://localhost:3001](http://localhost:3000) | Frontend |
| [http://localhost:8082](http://localhost:8082) | Frontend Documentation |
| [http://localhost:6007](http://localhost:6007) | Frontend Storybook |
| [http://localhost:3002](http://localhost:3002) | Admin |
Expand Down
1 change: 1 addition & 0 deletions deployment/local-testing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vagrant
20 changes: 20 additions & 0 deletions deployment/local-testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Local test deployment

Currently, we're deploying to a vServer. The following will set up virtual machines locally in order to test out the deployment before it hits `staging` or `production`.

1. Install [Vagrant](https://www.vagrantup.com/) on your machine

1. `cd deployment/local-testing`

1. `vagrant up` .. and wait

1. Following services are running:
- <http://localhost:8000/>
- <http://localhost:8000/api>
- <http://localhost:8000/docs>
- <http://localhost:8080/>
- <http://localhost:8082/>

1. Be amazed

In the future we might want to use [Ansible](https://www.ansible.com/) for provisioning. We could run our playbooks against this virtual machine, too.
13 changes: 13 additions & 0 deletions deployment/local-testing/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Defines our Vagrant environment
#
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = 'generic/alpine319'
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.network "forwarded_port", guest: 80, host: 8000
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 8082, host: 8082
end
40 changes: 40 additions & 0 deletions deployment/local-testing/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

apk update
apk upgrade
apk add nginx openrc nodejs npm git mysql mysql-client


npm install pm2 -g
pm2 startup

rc-update add pm2 boot
rc-update add nginx boot
service nginx start


service mariadb setup
rc-update add mariadb boot
sed -e '/skip-networking/ s/^#*/#/' -i /etc/my.cnf.d/mariadb-server.cnf
service mariadb start


cd /var/www/localhost/htdocs/
git clone https://github.com/dreammall-earth/dreammall.earth.git
cd dreammall.earth

mkdir -p /etc/nginx/http.d
cp -f ./deployment/nginx/default.conf /etc/nginx/http.d/default.conf
cp ./deployment/nginx/frontend.conf /etc/nginx/http.d/frontend.conf
cp ./deployment/nginx/admin.conf /etc/nginx/http.d/admin.conf

service nginx restart

mysql -e "CREATE USER 'dreammall'@'localhost' IDENTIFIED BY 'SECRET'; GRANT ALL PRIVILEGES ON * . * TO 'dreammall'@'localhost'; FLUSH PRIVILEGES;"

cp backend/.env.dist backend/.env
cp presenter/.env.dist presenter/.env
cp frontend/.env.dist frontend/.env
cp admin/.env.dist admin/.env

deployment/deploy.sh
26 changes: 1 addition & 25 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ services:
# PRESENTER ############################################
########################################################
presenter:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/presenter:local-development
build:
target: development
ports:
Expand All @@ -31,8 +29,6 @@ services:
# PRESENTER STORYBOOK #################################
#######################################################
presenter-storybook:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/presenter:local-storybook
build:
context: ./presenter
target: storybook
Expand All @@ -51,8 +47,6 @@ services:
# PRESENTER DOCUMENTATION #############################
#######################################################
presenter-documentation:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/presenter:local-documentation
build:
context: ./presenter
target: documentation
Expand All @@ -71,8 +65,6 @@ services:
# FRONTEND #############################################
########################################################
frontend:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/frontend:local-development
build:
target: development
ports:
Expand All @@ -92,8 +84,6 @@ services:
# FRONTEND STORYBOOK ##################################
#######################################################
frontend-storybook:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/frontend:local-storybook
build:
context: ./frontend
target: storybook
Expand All @@ -112,8 +102,6 @@ services:
# FRONTEND DOCUMENTATION ##############################
#######################################################
frontend-documentation:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/frontend:local-documentation
build:
context: ./frontend
target: documentation
Expand All @@ -132,8 +120,6 @@ services:
# ADMIN ################################################
########################################################
admin:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/admin:local-development
build:
target: development
ports:
Expand All @@ -153,8 +139,6 @@ services:
# ADMIN STORYBOOK #####################################
#######################################################
admin-storybook:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/admin:local-storybook
build:
context: ./admin
target: storybook
Expand All @@ -173,8 +157,6 @@ services:
# ADMIN DOCUMENTATION #################################
#######################################################
admin-documentation:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/admin:local-documentation
build:
context: ./admin
target: documentation
Expand All @@ -193,8 +175,6 @@ services:
# BACKEND #############################################
#######################################################
backend:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/backend:local-development
build:
context: ./backend
target: development
Expand All @@ -211,8 +191,6 @@ services:
# BACKEND DOCUMENTATION ###############################
#######################################################
backend-documentation:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/backend:local-documentation
build:
context: ./backend
target: documentation
Expand All @@ -231,8 +209,6 @@ services:
# DOCUMENTATION ########################################
########################################################
documentation:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/dreammall:local-documentation
build:
target: documentation
ports:
Expand All @@ -258,4 +234,4 @@ volumes:
admin_documentation_node_modules:
backend_node_modules:
backend_documentation_node_modules:
documentation_node_modules:
documentation_node_modules:
8 changes: 0 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ services:
# PRESENTER ############################################
########################################################
presenter:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/presenter:local-production
build:
context: ./presenter
target: production
Expand All @@ -39,8 +37,6 @@ services:
# FRONTEND #############################################
########################################################
frontend:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/frontend:local-production
build:
context: ./frontend
target: production
Expand All @@ -56,8 +52,6 @@ services:
# ADMIN ################################################
########################################################
admin:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: dreammall/admin:local-production
build:
context: ./admin
target: production
Expand All @@ -73,8 +67,6 @@ services:
# BACKEND #############################################
#######################################################
backend:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: it4c/backend:local-production
build:
context: ./backend
target: production
Expand Down
4 changes: 0 additions & 4 deletions tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c6628b

Please sign in to comment.