Skip to content

Commit

Permalink
ci: update docker configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ebonian committed Oct 16, 2024
1 parent 5633981 commit a33924d
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ COPY . .

ENV NEXT_TELEMETRY_DISABLED=1

RUN npx prisma generate
RUN \
if [ -f yarn.lock ]; then SKIP_ENV_VALIDATION=1 yarn build; \
elif [ -f package-lock.json ]; then SKIP_ENV_VALIDATION=1 npm run build; \
Expand All @@ -42,7 +43,7 @@ RUN \

##### RUNNER

FROM gcr.io/distroless/nodejs20-debian12 AS runner
FROM base AS runner
WORKDIR /app

ENV NODE_ENV=production
Expand All @@ -55,6 +56,7 @@ COPY --from=builder /app/package.json ./package.json

COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --chown=nextjs:nodejs prisma ./prisma/

EXPOSE 3000
ENV PORT=3000
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
pnpm install

# start db
docker compose -f docker/docker-compose.dev.yml up -d
docker compose up postgres

# start dev
pnpm dev
Expand Down
38 changes: 38 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: tech-website
services:
postgres:
image: postgres:latest
container_name: tech-website-postgres
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: tech-website
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- default

web:
build:
context: .
dockerfile: Dockerfile
args:
DIRECTUS_URL: ${DIRECTUS_URL}
container_name: tech-website-web
ports:
- "3000:3000"
env_file:
- .env
networks:
- default
restart: unless-stopped

volumes:
postgres-data:

networks:
default:
driver: bridge
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"react-dom": "^18.3.1",
"react-scroll": "^1.9.0",
"server-only": "^0.0.1",
"sharp": "^0.33.5",
"superjson": "^2.2.1",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
Expand Down
Loading

0 comments on commit a33924d

Please sign in to comment.