Skip to content

How to use postgres configuration from .env file in piccolo_conf.py? #596

Answered by Tar8117
Tar8117 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello! Finally, I did it.

I created a new file, docker-entrypoint.sh . At the same level as my Dockerfile and docker-compose.yml.

#!/bin/bash

# Apply database migrations
# echo "Apply database migrations"
# piccolo migrations new home --auto

# Run database migrations
echo "Running database migrations"
piccolo migrations forwards session_auth
piccolo migrations forwards user
piccolo migrations forwards home

# Start server
echo "Starting server"
uvicorn app:app --host 0.0.0.0 --port 8000 --reload

Changed my Dockerfile.

FROM python:3.8-slim
WORKDIR /code
COPY requirements.txt /code
RUN pip install -r /code/requirements.txt --no-cache-dir
COPY . /code
RUN ["chmod", "+x", "./docker-entryp…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dantownsend
Comment options

Comment options

You must be logged in to vote
3 replies
@dantownsend
Comment options

@Tar8117
Comment options

@dantownsend
Comment options

Answer selected by Tar8117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants