forked from Nine-Minds/alga-psa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prod
51 lines (36 loc) · 1.11 KB
/
Dockerfile.prod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM node:20.9-alpine
# TODO - remove duplication between this image and the others built during the compose build
# Install required system dependencies
RUN apk add --no-cache \
graphicsmagick \
imagemagick \
ghostscript \
postgresql-client \
redis \
curl \
bash
WORKDIR /app/server
# Copy root package.json first (will be copied from the build context)
COPY package.json package-lock.json /app/
# Copy server package.json
COPY server/package.json server/package-lock.json ./
# Install dependencies from root package.json
WORKDIR /app
RUN npm install
# Go back to server directory
WORKDIR /app/server
# Copy the server directory contents
COPY server/ ./
RUN npm run build
# Copy entrypoint script from project root
COPY server/entrypoint.sh /app/entrypoint.sh
# Make entrypoint script executable
RUN chmod +x /app/entrypoint.sh
# Remove any existing .env file to prevent conflicts
RUN rm -f ./.env
# Make port 3000 available to the world outside this container
EXPOSE 3000
# Define environment variable
ENV NODE_ENV=production
# Set the entrypoint script
ENTRYPOINT ["/app/entrypoint.sh"]