Setup prod settings

This commit is contained in:
IRBorisov 2023-08-08 16:14:58 +03:00
parent 586052f671
commit 8e2b91402f
5 changed files with 9 additions and 13 deletions

View File

@ -1,10 +1,10 @@
volumes: volumes:
postgres_volume: postgres_volume:
name: "portal-db" name: "postgresql-db"
django_static_volume: django_static_volume:
name: "portal-static" name: "static"
django_media_volume: django_media_volume:
name: "portal-media" name: "media"
networks: networks:
default: default:
@ -19,7 +19,6 @@ secrets:
services: services:
frontend: frontend:
restart: always restart: always
container_name: "portal-front"
depends_on: depends_on:
- backend - backend
build: build:
@ -31,7 +30,6 @@ services:
backend: backend:
restart: always restart: always
container_name: "portal-back"
depends_on: depends_on:
- postgresql-db - postgresql-db
- nginx - nginx
@ -55,7 +53,6 @@ services:
postgresql-db: postgresql-db:
restart: always restart: always
container_name: "portal-db"
image: postgres:alpine image: postgres:alpine
secrets: secrets:
- db_password - db_password
@ -68,7 +65,6 @@ services:
nginx: nginx:
restart: always restart: always
container_name: "portal-nginx"
build: build:
context: ./nginx context: ./nginx
ports: ports:

View File

@ -1,12 +1,12 @@
upstream innerdjango { upstream innerdjango {
server backend:8000; server back:8000;
# `backend` is the service's name in docker-compose.yml, # `backend` is the service's name in docker-compose.yml,
# The `innerdjango` is the name of upstream, used by nginx below. # The `innerdjango` is the name of upstream, used by nginx below.
} }
server { server {
listen 80; listen 80;
server_name portal.acconcept.ru; server_name localhost dev.concept.ru www.dev.concept.ru portal.acconcept.ru www.portal.acconcept.ru;
location / { location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host; proxy_set_header Host $host;

View File

@ -82,9 +82,9 @@ MIDDLEWARE = [
] ]
ROOT_URLCONF = 'project.urls' ROOT_URLCONF = 'project.urls'
LOGIN_URL = '/accounts/login/' LOGIN_URL = '/admin/login/'
LOGIN_REDIRECT_URL = '/home' LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/home' LOGOUT_REDIRECT_URL = '/'
TEMPLATES = [ TEMPLATES = [
{ {

View File

@ -11,6 +11,7 @@ WORKDIR /result
COPY ./ ./ COPY ./ ./
RUN npm install RUN npm install
ENV NODE_ENV production
RUN npm run build RUN npm run build
# ========= Server ======= # ========= Server =======

View File

@ -1,7 +1,6 @@
// Constants // Constants
const prod = { const prod = {
backend: 'http://dev.concept.ru:8000', backend: 'http://dev.concept.ru:8000',
// backend: 'http://localhost:8000',
}; };
const dev = { const dev = {