File size: 993 Bytes
f791990
e833ab5
86042ad
e833ab5
86042ad
 
7e4d893
 
 
 
 
 
 
 
3602c0b
 
 
 
17f9693
3602c0b
 
f791990
 
86042ad
9f5631e
 
f791990
9f5631e
86042ad
f791990
86042ad
 
653fc45
 
 
f791990
e833ab5
9f5631e
e833ab5
86042ad
9f5631e
86042ad
17f9693
35d653a
 
 
17f9693
35d653a
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
# Use official Node base image
FROM node:20-slim

# Set working directory
WORKDIR /app

# Install dependencies
RUN apt-get update && apt-get install -y \
    curl \
    bash \
    git \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Install Encore CLI to a system location that will persist
RUN curl -L https://encore.dev/install.sh | bash && \
    cp /root/.encore/bin/encore /usr/local/bin/encore && \
    chmod +x /usr/local/bin/encore

# Verify installation
RUN /usr/local/bin/encore version

# Copy workspace files
COPY package*.json ./
COPY backend ./backend

# Move into backend workspace
WORKDIR /app/backend

# Install Node dependencies
RUN npm install

# Fix permissions - ensure the container can write to the backend directory
RUN chmod -R 777 /app/backend

# Expose app port
EXPOSE 7860

# Environment variables
ENV NODE_ENV=production
ENV PORT=7860

# Copy start script
COPY start.sh /app/start.sh
RUN chmod +x /app/start.sh

# Start Encore app
CMD ["/app/start.sh"]