-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): added docker integration
- Loading branch information
1 parent
d78a631
commit afa033b
Showing
6 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3.4" | ||
### OMS STATUTORY ####################################### | ||
services: | ||
oms-core-js: | ||
build: | ||
context: ./${PATH_OMS_CORE_JS}/.. | ||
dockerfile: ./docker/oms-statutory/Dockerfile | ||
image: aegee/oms-statutory:dev | ||
volumes: | ||
- /usr/app/src/node_modules | ||
- ./${PATH_OMS_CORE_JS}/../:/usr/app/src |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: "3.4" | ||
|
||
services: | ||
postgres-oms-core-js: | ||
restart: always | ||
image: postgres:10 | ||
volumes: | ||
- postgres-oms-core-js:/var/lib/postgresql/data | ||
expose: | ||
- "5432" | ||
environment: | ||
POSTGRES_USER: "postgres" | ||
POSTGRES_PASSWORD: "${PW_POSTGRES}" | ||
|
||
oms-core-js: | ||
restart: always | ||
image: aegee/oms-core-js:latest | ||
volumes: | ||
- oms-core-js-media:/usr/app/media | ||
- shared:/usr/app/shared:ro | ||
depends_on: | ||
- postgres-oms-core-js | ||
expose: | ||
- "8084" | ||
environment: | ||
BUGSNAG_KEY: "${BUGSNAG_KEY_CORE_JS}" | ||
PG_PASSWORD: "${PW_POSTGRES}" | ||
NODE_ENV: "${MYAEGEE_ENV}" | ||
HOST: "${SUBDOMAIN_FRONTEND}${BASE_URL}" | ||
CORE_LOGIN: "${CORE_LOGIN}" | ||
CORE_PASSWORD: "${CORE_PASSWORD}" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8084/healthcheck"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 40s | ||
labels: | ||
- "traefik.backend=oms-core-js" | ||
- "traefik.port=8084" | ||
- "traefik.frontend.rule=PathPrefix:/api/core;PathPrefixStrip:/api/core" | ||
- "traefik.frontend.priority=110" | ||
- "traefik.enable=true" | ||
|
||
volumes: | ||
postgres-oms-core-js: | ||
driver: local | ||
oms-core-js-media: | ||
driver: local | ||
shared: | ||
driver: local | ||
|
||
networks: | ||
default: | ||
external: | ||
name: OMS |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:12 | ||
|
||
RUN mkdir -p /usr/app/src \ | ||
&& mkdir -p /usr/app/media \ | ||
&& mkdir -p /usr/app/scripts | ||
|
||
RUN apt-get update | ||
RUN apt-get install netcat -y | ||
|
||
COPY ./docker/oms-statutory/bootstrap.sh /usr/app/scripts/bootstrap.sh | ||
COPY ./docker/oms-statutory/wait.sh /usr/app/scripts/wait.sh | ||
COPY . /usr/app/src | ||
|
||
RUN chown -R node:node /usr/app | ||
|
||
WORKDIR /usr/app/src | ||
|
||
USER node | ||
|
||
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | ||
ENV PATH="/home/node/.npm-global/bin:${PATH}" | ||
|
||
RUN npm install -g --loglevel warn nodemon && npm cache clean --force | ||
RUN npm install --loglevel warn | ||
|
||
CMD sh /usr/app/scripts/bootstrap.sh && nodemon -e "js,json" lib/run.js | ||
|
||
EXPOSE 8084 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
echo "Creating database..." | ||
npm run db:create | ||
echo "Migrating database..." | ||
npm run db:migrate |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
echo "Waiting for bootstrap" | ||
|
||
while ! nc -z localhost 8084; do | ||
sleep 0.1 | ||
done | ||
|
||
echo "Bootstrap finished" | ||
|