-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc0e034
commit d123ce6
Showing
12 changed files
with
490 additions
and
357 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 @@ | ||
node_modules |
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 @@ | ||
MONGODB_STORAGE=/data/mongodb-test |
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,16 @@ | ||
FROM node:20 | ||
|
||
ARG MONGODB_URL | ||
ENV MONGODB_URL $MONGODB_URL | ||
|
||
WORKDIR /opt/application/api | ||
COPY . . | ||
|
||
RUN npm install | ||
RUN npm run build | ||
|
||
CMD npm run migrate \ | ||
&& rm -rf ../api-build/node_modules \ | ||
&& cp -r node_modules ../api-build \ | ||
&& npm start | ||
|
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
version: '3.8' | ||
|
||
services: | ||
mongo: | ||
image: mongo | ||
restart: always | ||
volumes: | ||
- /tmp/mongodb-test:/data/db | ||
- api-build:/opt/application/api-build | ||
ports: | ||
- 27017:27017 | ||
logging: | ||
driver: none | ||
network_mode: host | ||
|
||
api: | ||
build: | ||
context: api | ||
network: host | ||
args: | ||
MONGODB_URL: mongodb://0.0.0.0:27017/testdb | ||
restart: always | ||
depends_on: | ||
- mongo | ||
volumes: | ||
- api-build:/opt/application/api-build | ||
env_file: api/production.env | ||
network_mode: host | ||
|
||
web: | ||
build: | ||
context: web | ||
depends_on: | ||
- api | ||
volumes: | ||
- api-build:/opt/application/api | ||
- web-build:/var/www/html | ||
|
||
nginx: | ||
build: | ||
context: nginx | ||
restart: always | ||
depends_on: | ||
- web | ||
volumes: | ||
- web-build:/var/www/html | ||
network_mode: host | ||
|
||
volumes: | ||
api-build: | ||
web-build: | ||
|
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 @@ | ||
FROM nginx | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY sites-enabled/ /etc/nginx/sites-enabled | ||
|
||
CMD nginx -g 'daemon off;' |
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,20 @@ | ||
events {} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
include /etc/nginx/sites-enabled/*.conf; | ||
client_max_body_size 50m; | ||
proxy_read_timeout 600s; | ||
|
||
gzip on; | ||
gzip_min_length 1000; | ||
gzip_comp_level 9; | ||
gzip_types | ||
text/plain | ||
text/html | ||
text/css | ||
application/javascript; | ||
|
||
proxy_cache_path /var/nginx-cache keys_zone=static:10m; | ||
} | ||
|
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,20 @@ | ||
server { | ||
listen 80; | ||
root /var/www/html; | ||
|
||
location ~ ^/(static|assets)/ { | ||
proxy_cache static; | ||
expires 30d; | ||
add_header Cache-Control "public, no-transform"; | ||
} | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://0.0.0.0:3000; | ||
proxy_set_header Host $host; | ||
proxy_cache off; | ||
} | ||
} |
Oops, something went wrong.