Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize dev environment 🐳 #285

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1f9e7b4
Split .gitignores
nathanaelhoun May 1, 2021
46cb42b
Disabling version on about page (temporary)
nathanaelhoun May 1, 2021
597fc6d
Dockerfiles for independant services
nathanaelhoun May 1, 2021
f349a34
Add docker-compose to orchestrate all of these!
nathanaelhoun May 1, 2021
b22ca87
Better configurations
nathanaelhoun May 1, 2021
6d4e2f0
Show version in client
nathanaelhoun May 1, 2021
fec1561
Dev dockerfiles in progress: no volumes and networking is not on point
nathanaelhoun May 1, 2021
38f0d1d
Docker-compose for dev-environement
nathanaelhoun May 2, 2021
76af23d
Invert docker-compose dev and prod
nathanaelhoun May 2, 2021
a4a1add
Yay container really depends on
nathanaelhoun May 2, 2021
cb2bc68
Actually, it's 2.4 to have condition: service_healthy
nathanaelhoun May 2, 2021
2300a5a
Use rootfs folders
nathanaelhoun Jul 15, 2021
b494f3e
Merge branch 'main' into hey-its-tweny-tweny-lets-dockerize-this-app
nathanaelhoun Jul 15, 2021
1ef8a77
Add LDAP informations to production dockerfile
nathanaelhoun Jul 15, 2021
c3534af
Added npm install to dockerfile in dev environment
nathanaelhoun Jul 15, 2021
1555b48
Add npm management to dev dockerfiles
nathanaelhoun Jul 15, 2021
9b59bcf
Merge branch 'main' into hey-its-tweny-tweny-lets-dockerize-this-app
nathanaelhoun Mar 13, 2022
120f19c
random: Je sais plus où j'en étais et je commit ici
nathanaelhoun Mar 25, 2022
2003d01
chore: Create a new dev-env.sh script to manage dev environment with …
nathanaelhoun Mar 25, 2022
d4d9ec6
chore(ci): Update variable environment names
nathanaelhoun Mar 25, 2022
3f47d17
chore: Rename main .env to dev.env
nathanaelhoun Mar 25, 2022
30a4389
fix: Do not hardcode .env file path in import-env.js
nathanaelhoun Mar 25, 2022
1cd7b38
chore: Formatting
nathanaelhoun Mar 25, 2022
0ba2fbf
docs: Minor changes to match the wiki
nathanaelhoun Mar 25, 2022
e83bfc6
chore: Remove docker for production
nathanaelhoun Mar 25, 2022
35a752b
fix: Replace .env by dev.env in docker-compose.dev.yml
nathanaelhoun Mar 25, 2022
a12da90
feat: dev-env.sh test (but tests are failing)
nathanaelhoun Mar 25, 2022
b15a1d1
ci: Fix env variables?
nathanaelhoun Mar 25, 2022
b3cc57a
ci: Fix trailing quotes
nathanaelhoun Mar 25, 2022
39b139b
fix: *) case in dev-env.sh
nathanaelhoun Mar 27, 2022
5a304e5
chore: Removed useless console.debug
nathanaelhoun Mar 27, 2022
f27dbdf
fix: Refresh & access tokens now use the new env variables
nathanaelhoun Mar 27, 2022
c3f81d0
chore: Remove rootfs/ and bring back production version in about page
nathanaelhoun Mar 27, 2022
2a51d23
fix: successful user authentification with ldap
nathanaelhoun Feb 17, 2023
d43ab36
docs: better dev-env script
nathanaelhoun Feb 17, 2023
e89961a
chore: add dev-env command to create user
nathanaelhoun Feb 17, 2023
40fc823
chore: dev-env trap sigint sooner
nathanaelhoun Feb 17, 2023
36ab12d
docs: better padding
nathanaelhoun Feb 17, 2023
0f9ae27
fix: somes changes at right and left
nathanaelhoun Feb 17, 2023
98fc574
chore: updated githooks
nathanaelhoun Feb 17, 2023
bfa021c
feat: choose password on cli
nathanaelhoun Feb 17, 2023
c6fa8f9
fix: bring back check_npm_deps
nathanaelhoun Feb 17, 2023
70035b4
feat: allow to create admin user
nathanaelhoun Feb 17, 2023
134d153
feat: add seed command
nathanaelhoun Feb 17, 2023
5259253
fix: dev-env.sh tests
nathanaelhoun Feb 17, 2023
8d22a20
fix: seeded user shouldn't be admin
nathanaelhoun Feb 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -----------------------------------------------------------------------------
# Mariadb container variables
MYSQL_DATABASE=apothiquizDb
MYSQL_USER=apothiquizUser
MYSQL_PASSWORD=apothiquizPassword

# -----------------------------------------------------------------------------
# OpenLDAP container variables

# -----------------------------------------------------------------------------
# Server configuration
NODE_ENV=development
APOTHIQUIZ_SERVER_PORT=5035

# Token private keys : for production, these keys must be random hashes !
# https://www.random.org/passwords/?num=5&len=24&format=html&rnd=new or `openssl rand -base64 32`
APOTHIQUIZ_ACCESS_TOKEN_KEY=__ACCESS_TMP__
APOTHIQUIZ_REFRESH_TOKEN_KEY=__REFRESH_TMP__
APOTHIQUIZ_DB_HOST=localhost # The docker mariadb container is bind on localhost
APOTHIQUIZ_DB_PORT=3306 # Default mariadb port bound in docker-compose.dev.yml
APOTHIQUIZ_DB_DATABASE=apothiquizDb # Same as ${MYSQL_DATABASE}
APOTHIQUIZ_DB_DATABASE_TEST=apothiquizDb # should be different if you don't want to override everything when launching unit tests
APOTHIQUIZ_DB_USER=apothiquizUser # same as ${MYSQL_USER}
APOTHIQUIZ_DB_PASSWORD=apothiquizPassword # same as ${MYSQL_PASSWORD}
APOTHIQUIZ_LDAP_URL=ldap://localhost # Container use default ldap port in docker-compose.dev.yml
APOTHIQUIZ_LDAP_DOMAIN="ou=users,dc=apothiquiz,dc=io" # Configured in docker-compose.dev.yml
29 changes: 13 additions & 16 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -38,7 +38,15 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

env:
APOTHIQUIZ_ACCESS_TOKEN_KEY: TMP_ACCESS_KEY
APOTHIQUIZ_REFRESH_TOKEN_KEY: TMP_REFRESH_KEY
APOTHIQUIZ_DB_HOST: localhost
APOTHIQUIZ_DB_DATABASE_TEST: apothiquizTestDb
APOTHIQUIZ_DB_USER: apothiquizUser
APOTHIQUIZ_DB_PASSWORD: p@ssword

steps:
- uses: actions/checkout@v2
Expand All @@ -55,9 +63,9 @@ jobs:
uses: getong/[email protected]
with:
mariadb version: "10.4.10"
mysql database: "apothiquizTestDb"
mysql user: "apothiquizUser"
mysql password: ${{ secrets.CI_DATABASE_PASS }}
mysql database: ${APOTHIQUIZ_DB_DATABASE_TEST}
mysql user: ${APOTHIQUIZ_DB_USER}
mysql password: ${APOTHIQUIZ_DB_PASSWORD}

- run: npm ci
working-directory: ./server
Expand All @@ -71,17 +79,6 @@ jobs:
- run: npm run build --if-present
working-directory: ./server

- name: Setting private key
run: |
echo "ACCESS_TOKEN_KEY=TMP_ACCESS_KEY" >> .env; \
echo "REFRESH_TOKEN_KEY=TMP_REFRESH_KEY" >> .env; \
echo "DB_HOST=localhost" >> .env; \
echo "DB_USER=apothiquizUser" >> .env; \
echo "DB_PASSWORD=p@ssword" >> .env; \
echo "DB_DATABASE_TEST=apothiquizTestDb" >> .env; \

working-directory: ./server

- name: Wait for mariadb server to be ready
env:
PORT: 3306
Expand Down
14 changes: 4 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
.idea/
node_modules/
wiki
server/.env
.eslintcache
server/logs/
server/files/
server/files-test/
uploads/
tmp/
*.env
!.env.example

docker-compose.override.yml
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache
Loading