Skip to content

Instantly share code, notes, and snippets.

View thiennn's full-sized avatar

Thien Nguyen Le Quynh thiennn

View GitHub Profile
@thiennn
thiennn / .editorConfig
Created July 12, 2023 06:38 — forked from RealDotNetDave/.editorConfig
.editorConfig by David (dotNetDave) McCarter - dotNetTips.com
# dotNetDave's (David McCarter) Editor Config - dotNetTips.com
# Updates to this file are posted quarterly at: https://bit.ly/EditorConfig5
# Updated May 2023
# dotNetDave's books available at: http://bit.ly/RockYourCodeBooks
# Rockin' the Code World with dotNetDave (weekly live show): https://www.c-sharpcorner.com/live/rockin-the-code-world-with-dotnetdave
root = true
# All Files
[*]
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "simplcommerce/simplcommerce-eb",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "80"
}
#!/bin/bash
set -e
if psql -h simpldb --username postgres -lqt | cut -d \| -f 1 | grep -qw simplcommerce; then
echo "simplcommerce database existed"
else
echo "create new database simplcommerce"
psql -h simpldb --username postgres -c "CREATE DATABASE simplcommerce WITH ENCODING 'UTF8'"
psql -h simpldb --username postgres -d simplcommerce -a -f /app/dbscript.sql
psql -h simpldb --username postgres -d simplcommerce -a -f /app/StaticData_Postgres.sql
FROM simplcommerce/simpl-sdk AS build-env
WORKDIR /app
COPY . ./
RUN sed -i 's#<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0-preview2-final" />#<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.0.0-preview2-final" />#' src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj
RUN sed -i 's/UseSqlServer/UseNpgsql/' src/SimplCommerce.WebHost/Program.cs
RUN sed -i 's/UseSqlServer/UseNpgsql/' src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs
RUN rm src/SimplCommerce.WebHost/Migrations/* && cp -f src/SimplCommerce.WebHost/appsettings.docker.json src/SimplCommerce.WebHost/appsettings.json
@thiennn
thiennn / dockerinitcontainer.sh
Last active January 4, 2017 02:32
a shell script for simplcommerce-first-Dockerfile
#!/bin/bash
set -e
cd /app/src/SimplCommerce.WebHost && dotnet ef database update
psql --username postgres -d simplcommerce -a -f /app/src/Database/StaticData_Postgres.sql
cd /app/src/SimplCommerce.WebHost && dotnet run
@thiennn
thiennn / Dockerfile
Created December 1, 2016 06:58
simplcommerce-first-Dockerfile
FROM postgres:9.5
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
libc6 \
libcurl3 \
libgcc1 \