Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add docker / docker-compose (WIP)
- Loading branch information
Showing
27 changed files
with
311 additions
and
142 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# API | ||
|
||
FROM node:alpine | ||
|
||
RUN apk update | ||
|
||
RUN npm i -g npm | ||
|
||
RUN apk add libexecinfo libexecinfo-dev | ||
|
||
RUN apk --no-cache add --virtual builds-deps build-base \ | ||
snappy g++ snappy-dev gcc libgcc libstdc++ linux-headers autoconf automake make nasm python git && \ | ||
npm install --quiet node-gyp -g | ||
|
||
RUN npm config set python /usr/bin/python | ||
|
||
RUN npm install yarn -g | ||
|
||
RUN npm install pm2 -g --unsafe-perm | ||
|
||
# Make our app folder (empty for now) | ||
RUN mkdir -p /usr/src/app | ||
|
||
# Provides cached layer for node_modules and bower_components | ||
ADD package.json /tmp/package.json | ||
ADD apps/api/package.json /tmp/apps/api/package.json | ||
# COPY .snyk /tmp/.snyk | ||
COPY yarn.lock /tmp/yarn.lock | ||
RUN cd /tmp/ && yarn install | ||
RUN cp -a /tmp/node_modules /usr/src/app/ | ||
RUN cd /usr/src/app | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Bundle app source | ||
ADD . /usr/src/app | ||
|
||
EXPOSE 3000 | ||
|
||
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.5.0/wait /wait | ||
RUN chmod +x /wait | ||
|
||
CMD /wait && yarn run api:seedData && yarn run start:api:prod |
Empty file.
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,23 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
|
||
error_log /etc/nginx/error.log warn; | ||
client_max_body_size 20m; | ||
|
||
upstream webapp { | ||
server webapp:4200; | ||
} | ||
|
||
server { | ||
server_name gauzy.dev; | ||
|
||
location / { | ||
proxy_pass http://webapp; | ||
} | ||
|
||
listen 8080; | ||
} | ||
} |
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,42 @@ | ||
# Webapp | ||
|
||
FROM node:alpine | ||
|
||
RUN apk update | ||
|
||
RUN npm i -g npm | ||
|
||
RUN apk add libexecinfo libexecinfo-dev | ||
|
||
RUN apk --no-cache add --virtual builds-deps build-base \ | ||
snappy g++ snappy-dev gcc libgcc libstdc++ linux-headers autoconf automake make nasm python git && \ | ||
npm install --quiet node-gyp -g | ||
|
||
RUN npm config set python /usr/bin/python | ||
|
||
RUN npm install yarn -g | ||
|
||
RUN npm install pm2 -g --unsafe-perm | ||
|
||
# Make our app folder (empty for now) | ||
RUN mkdir -p /usr/src/app | ||
|
||
# Provides cached layer for node_modules and bower_components | ||
ADD package.json /tmp/package.json | ||
# COPY .snyk /tmp/.snyk | ||
COPY yarn.lock /tmp/yarn.lock | ||
RUN cd /tmp/ && yarn install | ||
RUN cp -a /tmp/node_modules /usr/src/app/ | ||
RUN cd /usr/src/app | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Bundle app source | ||
ADD . /usr/src/app | ||
|
||
EXPOSE 4200 | ||
|
||
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.5.0/wait /wait | ||
RUN chmod +x /wait | ||
|
||
CMD /wait && yarn run start:gauzy:prod |
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 @@ | ||
dist | ||
tmp | ||
.github | ||
.npmrc | ||
.travis.yml | ||
greenkeeper.json | ||
docker-compose.yml | ||
*.md | ||
.deploy | ||
.git/ | ||
.gitignore | ||
node_modules | ||
|
||
# IDEs and editors | ||
.idea | ||
.vscode | ||
.project | ||
.classpath | ||
*.launch | ||
.settings/ | ||
|
||
# e2e | ||
e2e/*.js | ||
e2e/*.map | ||
|
||
#System Files | ||
.DS_Store | ||
Thumbs.db |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
# dependencies | ||
/node_modules | ||
|
||
/apps/api/node_modules | ||
# IDEs and editors | ||
/.idea | ||
.project | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,3 +1,27 @@ | ||
export const environment = { | ||
production: true | ||
import { IEnvironment } from './ienvironment'; | ||
|
||
export const environment : IEnvironment = { | ||
production: true, | ||
envName: 'prod', | ||
env: { | ||
LOG_LEVEL: 'debug' | ||
}, | ||
USER_PASSWORD_BCRYPT_SALT_ROUNDS: 12, | ||
JWT_SECRET: 'secretKey', | ||
database: { | ||
type: 'postgres', | ||
host: 'db', | ||
port: 5432, | ||
database: 'postgres', | ||
username: 'postgres', | ||
password: 'root', | ||
keepConnectionAlive: true, | ||
logging: true, | ||
synchronize: true, | ||
uuidExtension: 'pgcrypto', | ||
}, | ||
defaultAdmin: { | ||
email: 'admin@ever.co', | ||
password: "admin" | ||
} | ||
}; |
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,6 @@ | ||
{ | ||
"/api": { | ||
"target": "http://api:3000", | ||
"secure": false | ||
} | ||
} |
Oops, something went wrong.