# Use an official ubuntu image
FROM hatiolab/operato-env:latest

# Set the working directory to /app
WORKDIR /app

# copy application & configuration files
COPY . .

# run node install command
RUN yarn install

# Install required packages (necessary for locale setup)
RUN apt-get update && apt-get install -y locales tzdata

# Generate the en_US.UTF-8 locale
RUN locale-gen en_US.UTF-8

# Set environment variables for locale and timezone
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV TZ=UTC

# Set timezone to UTC (using tzdata)
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo "UTC" > /etc/timezone

# Make port 3000 available to the world outside this container
EXPOSE 3000

CMD [ "yarn", "run", "serve" ]