Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
kimachinskiy committed Oct 10, 2023
1 parent 6cf512f commit 02ddad7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 47 deletions.
39 changes: 12 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
FROM python:3.9-alpine

WORKDIR /Forum
RUN mkdir -p /home/forum

RUN addgroup -S forum && adduser -S forum -G forum

ENV HOME=/home/forum
ENV APP_HOME=/home/forum/app
RUN mkdir $APP_HOME

WORKDIR $APP_HOME

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
RUN apk update \
&& apk add postgresql-dev gcc python3-dev musl-dev

RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip3 install -r requirements.txt

# FROM python:3.9-alpine

# RUN mkdir -p /home/forum

# RUN addgroup -S forum && adduser -S forum -G forum

# ENV HOME=/home/forum
# ENV APP_HOME=/home/forum/app
# RUN mkdir $APP_HOME

# WORKDIR $APP_HOME

# ENV PYTHONDONTWRITEBYTECODE 1
# ENV PYTHONUNBUFFERED 1

# RUN apk update \
# && apk add postgresql-dev gcc python3-dev musl-dev

# RUN pip install --upgrade pip
# COPY ./requirements.txt .
# RUN pip3 install -r requirements.txt

# COPY . $APP_HOME
COPY . $APP_HOME

# RUN chown -R forum:forum $APP_HOME
RUN chown -R forum:forum $APP_HOME

# USER forum
USER forum
4 changes: 2 additions & 2 deletions docker-compose.db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ services:
image: dpage/pgadmin4
container_name: pgadmin
restart: always
ports:
- 5050:80
# ports:
# - 5050:80
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
Expand Down
32 changes: 16 additions & 16 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ services:
restart: on-failure
command: gunicorn forum.wsgi:application --bind 0.0.0.0:8000
volumes:
- ./:/Forum
# - static:/home/forum/app/public/static
# - media:/home/forum/app/public/media
# - ./:/Forum
- static:/home/forum/app/public/static
- media:/home/forum/app/public/media
ports:
- 8000:8000
environment:
Expand All @@ -31,19 +31,19 @@ services:
- CORS_ORIGIN_WHITELIST=${CORS_ORIGIN_WHITELIST}
networks:
- forum_network
# frontend:
# container_name: frontend
# volumes:
# - static:/home/forum/app/public/static
# environment:
# - REACT_APP_BASE_API_URL=${REACT_APP_BASE_API_URL}
# ports:
# - 80:80
# build:
# context: ./FrontEnd
# target: production
# networks:
# - forum_network
frontend:
container_name: frontend
volumes:
- static:/home/forum/app/public/static
environment:
- REACT_APP_BASE_API_URL=${REACT_APP_BASE_API_URL}
ports:
- 80:80
build:
context: ./FrontEnd
target: production
networks:
- forum_network

networks:
forum_network:
Expand Down
4 changes: 2 additions & 2 deletions forum/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

# ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '0.0.0.0', '178.212.110.52', 'api-dev']
ALLOWED_HOSTS = ['*']
# ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '0.0.0.0']

# Application definition

Expand Down

0 comments on commit 02ddad7

Please sign in to comment.