A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and NGINX for routing.
A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and Nginx for routing.
CERTBOT_EMAIL
to your email for Let's Encrypt certificate generation. Moreover, set DOMAIN
to your domain name. The domain should point to the IP of the machine you're running this project on.appsettingsExample.json
needs to be renamed to appsettings.json
with your own OAuth keys:# clone the repo
$ git clone https://github.com/Scharkee/netcore-postgres-oauth-boiler.git
$ cd netcore-postgres-oauth-boiler
# perform configuration...
# generate TLS certificates and run on ports 80/443
# choose between docker-compose-linux.yml and docker-compose-windows.yml
$ docker-compose -f docker-compose-linux.yml up
For an explanation of the docker-compose file separation, take a look at Running on Windows.
docker-compose
section in the Solution Explorer, and click Set as Startup Project
Docker Compose
button to run.If you're behind Nginx or a similar reverse proxy setup, you can either:
DefaultConnection
in appsettings.json in accordance with your databasedocker build . --tag boiler
docker run boiler -p 3000:80 --name boiler
Docker on Windows has an open issue with local volume mapping permissions, which results in PostgreSQL not being able to write to a (relative) local directory. Thus, when running on Windows (via run.sh), an external volume is created, which is managed by Docker.
Moreover, if you encounter a PR_END_OF_FILE_ERROR when trying to load the website, try executing:
$ docker exec nginx bash -c "mv /etc/nginx/conf.d/boiler.conf{.nokey,} ; nginx -s reload"
This seems to be a symlink issue with Windows Docker containers as well. After renaming the file once, it does not need to be touched anymore (unless you purge the nginx container).
Submit bugs and requests through the project's issue tracker:
This project is licensed under the terms of the MIT license.