forked from i-barysiuk/bstu-curators
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request i-barysiuk#8 from i-barysiuk/F7/Prod_Dev_Env
Prod&Dev Environment
- Loading branch information
Showing
14 changed files
with
204 additions
and
50 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
/db | ||
/db | ||
/package.json | ||
npm-debug.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
events { | ||
worker_connections 1024; | ||
multi_accept on; | ||
} | ||
http { | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 15; | ||
types_hash_max_size 2048; | ||
server_tokens off; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type text/javascript; | ||
|
||
access_log off; | ||
error_log /var/log/nginx/error.log; | ||
|
||
gzip on; | ||
gzip_min_length 100; | ||
gzip_http_version 1.1; | ||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
client_max_body_size 8M; | ||
server { | ||
listen 80; | ||
|
||
root /usr/share/nginx/html; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location ~ \.css { | ||
add_header Content-Type text/css; | ||
} | ||
location ~ \.js { | ||
add_header Content-Type application/x-javascript; | ||
} | ||
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | ||
# Some basic cache-control for static files to be sent to the browser | ||
expires max; | ||
add_header Pragma public; | ||
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Stage 1 - the build process | ||
FROM node:latest as build-deps | ||
WORKDIR /usr/src/app | ||
COPY package.json ./ | ||
RUN npm install | ||
COPY . ./ | ||
RUN npm run build | ||
|
||
# Stage 2 - the production environment | ||
FROM nginx:stable-alpine | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=build-deps /usr/src/app/build /usr/share/nginx/html | ||
EXPOSE 80 | ||
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,14 @@ | ||
# Stage 1 - the build process | ||
FROM node:latest as build-deps | ||
WORKDIR /usr/src/app | ||
COPY package.json ./ | ||
RUN npm install | ||
COPY . ./ | ||
RUN npm run build:uat | ||
|
||
# Stage 2 - the production environment | ||
FROM nginx:stable-alpine | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=build-deps /usr/src/app/build /usr/share/nginx/html | ||
EXPOSE 80 | ||
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,36 @@ | ||
version: "3.7" | ||
|
||
services: | ||
db: | ||
image: postgres | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: trytofindme | ||
volumes: | ||
- ./db/db_prod:/var/lib/postgresql/data | ||
|
||
adminer: | ||
image: adminer | ||
restart: always | ||
ports: | ||
- 8002:8080 | ||
depends_on: | ||
- db | ||
|
||
app: | ||
build: | ||
context: ./app | ||
dockerfile: prod.Dockerfile | ||
restart: always | ||
ports: | ||
- 8000:80 | ||
|
||
server: | ||
build: | ||
context: ./server | ||
dockerfile: prod.Dockerfile | ||
restart: always | ||
ports: | ||
- 8001:3000 | ||
depends_on: | ||
- 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: "3.7" | ||
|
||
services: | ||
db_uat: | ||
image: postgres | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: trytofindme | ||
volumes: | ||
- ./db/db_uat:/var/lib/postgresql/data | ||
|
||
adminer_uat: | ||
image: adminer | ||
restart: always | ||
ports: | ||
- 8012:8080 | ||
|
||
app_uat: | ||
build: | ||
context: ./app | ||
dockerfile: uat.Dockerfile | ||
restart: always | ||
ports: | ||
- 8010:3000 | ||
|
||
server_uat: | ||
build: | ||
context: ./server | ||
dockerfile: uat.Dockerfile | ||
restart: always | ||
ports: | ||
- 8011:3000 |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ COPY . . | |
|
||
EXPOSE 3000 | ||
|
||
CMD sleep 15s && npm start | ||
CMD 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:latest | ||
WORKDIR /usr/src/app | ||
|
||
COPY ./package*.json ./ | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD npm run start:uat |