Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kn creating base functionality #1

Merged
merged 7 commits into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.git*
.svelte-kit/
node_modules/*
public/
build
.eslint*
.prettier*
.vscode
README.md
docker-compose.yml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vscode/
17 changes: 17 additions & 0 deletions Dockerfile.application
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Dockerfile for ASA Application

# Build Stage
FROM node:18-alpine AS deploy-app-builder
RUN mkdir /app
COPY . /app
RUN cd /app && npm install && npm run build

# Production Stage
FROM node:18-alpine
RUN mkdir /app
COPY --from=deploy-app-builder /app/build /app/build
COPY --from=deploy-app-builder /app/package.json /app/package.json
COPY --from=deploy-app-builder /app/package-lock.json /app/package-lock.json
RUN cd /app && npm install --production
WORKDIR /app
CMD [ "node", "./build" ]
12 changes: 12 additions & 0 deletions Dockerfile.database
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dockerfile for ASA Database

# Create Postgres
FROM postgres:15.3-alpine AS deploy-db
ENV POSTGRES_PASSWORD=postgres
ENV POSTGRES_USER=postgres
ENV POSTGRES_DB=asa-local-db

# Create pgAdmin
FROM dpage/pgadmin4:7.1 AS deploy-db-pgadmin
ENV PGADMIN_DEFAULT_EMAIL="admin@admin.com"
ENV PGADMIN_DEFAULT_PASSWORD="root"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Branch Example: `kn-feature-name-example`
- Nodejs
- NPM
- Git
- Docker Engine

### Development

Expand All @@ -52,4 +53,12 @@ npm run build

You can preview the production build with `npm run preview`.

### Docker

To create a full local environment, use the docker compose to create all services localy and the production application:

```bash
docker-compose up
```

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.8'
name: asa-stack
services:
db:
image: asa-db
container_name: asa-db
build:
context: .
dockerfile: Dockerfile.database
target: deploy-db
restart: always
ports:
- '5432:5432'
pgadmin:
image: asa-db-pgadmin
container_name: asa-db-pgadmin
build:
context: .
dockerfile: Dockerfile.database
target: deploy-db-pgadmin
depends_on:
- db
restart: always
ports:
- 5050:80
web:
image: asa-application
container_name: asa-application
build:
context: .
dockerfile: Dockerfile.application
depends_on:
- db
ports:
- '8080:3000'
Loading