Skip to content

Instantly share code, notes, and snippets.

@ggreenleaf
Last active June 30, 2022 12:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggreenleaf/f402ea09f38c7e6f398489adb920c55c to your computer and use it in GitHub Desktop.
Save ggreenleaf/f402ea09f38c7e6f398489adb920c55c to your computer and use it in GitHub Desktop.
SqlServer and azureite blob emulator docker compose with volumes
SQLSERVER_SA_PASSWORD=%%placeholder%%
SQLSERVER_DATA_PATH=/path/to/some/local/dir/data
SQLSERVER_LOG_PATH=/path/to/some/local/dir/log
SQLSERVER_SECRETS_PATH=/path/to/some/local/dir/secret
AZURITE_DATA_PATH=/path/to/some/local/dir/azurite
MIGRATION_CONNECTION_STRING=%%Placeholder%%
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 1433:1433
volumes:
- ${SQLSERVER_DATA_PATH}:/var/opt/mssql/data
- ${SQLSERVER_LOG_PATH}:/var/opt/mssql/log
- ${SQLSERVER_SECRETS_PATH}:/var/opt/mssql/secrets
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=${SQLSERVER_SA_PASSWORD}
azurite:
image: mcr.microsoft.com/azure-storage/azurite
ports:
- 10000:10000
- 10001:10001
- 10002:10002
volumes:
- ${AZURITE_DATA_PATH}:/data
app-migrations:
build: './db/'
image: app-migration
depends_on:
- sqlserver
environment:
- MIGRATION_CONNECTION_STRING=${MIGRATION_CONNECTION_STRING}
FROM erikbra/grate:latest
ENV MIGRATION_CONNECTION_STRING=""
WORKDIR /app
COPY ./migrations ./migrations
RUN mkdir /app/migration-output
ENTRYPOINT ./grate -f=migrations -c="$MIGRATION_CONNECTION_STRING" --outputPath=./migration-output --schema=RoundhousE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment