Skip to content

Commit

Permalink
Merge pull request #24 from Finboost/dev-arman
Browse files Browse the repository at this point in the history
feat(setup): update Dockerfile
  • Loading branch information
armandwipangestu authored Jun 13, 2024
2 parents c368b67 + a19667c commit a766049
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build stage
FROM node:20 AS build
FROM node:20-slim AS build

# Define build argument
ARG NODE_ENV
Expand Down Expand Up @@ -31,21 +31,21 @@ RUN dotenv -e .env.${NODE_ENV} -- npx prisma migrate deploy

# Stage 2: Run stage
# FROM gcr.io/distroless/nodejs20-debian12
FROM node:20-slim
# FROM node:20-slim

# Install tzdata and set timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
RUN ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
# RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
# RUN ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime && dpkg-reconfigure -f noninteractive tzdata

# Copy built files from the build stage
COPY --from=build /opt/app /opt/app
# COPY --from=build /opt/app /opt/app

# Set the working directory
WORKDIR /opt/app
# WORKDIR /opt/app

# Set environment variable for runtime
ENV NODE_ENV=${NODE_ENV}
ENV PORT=8080
# ENV NODE_ENV=${NODE_ENV}
# ENV PORT=8080
ENV TZ=Asia/Jakarta

# Expose the port
Expand Down

0 comments on commit a766049

Please sign in to comment.